0
0
mirror of https://github.com/rbock/sqlpp11.git synced 2024-11-15 20:31:16 +08:00

Fixed some "const" bugs and a parameter_tuple bug

This commit is contained in:
rbock 2014-01-18 22:40:13 +01:00
parent 24b44fae65
commit 63ac89accb
5 changed files with 9 additions and 9 deletions

View File

@ -102,7 +102,7 @@ namespace sqlpp
return _parameter_list_t::size::value;
}
size_t _get_no_of_parameters()
size_t _get_no_of_parameters() const
{
return _parameter_list_t::size::value; // FIXME: Need to add dynamic parameters here
}

View File

@ -141,7 +141,7 @@ namespace sqlpp
return _parameter_list_t::size::value;
}
size_t _get_no_of_parameters()
size_t _get_no_of_parameters() const
{
return _parameter_list_t::size::value; // FIXME: Need to add dynamic parameters here
}

View File

@ -558,7 +558,7 @@ namespace sqlpp
return _parameter_list_t::size::value;
}
size_t _get_no_of_parameters()
size_t _get_no_of_parameters() const
{
return _parameter_list_t::size::value; // FIXME: Need to add dynamic parameters here
}
@ -584,8 +584,8 @@ namespace sqlpp
// Prepare
template<typename Db>
auto prepare(Db& db)
-> prepared_select_t<typename std::decay<Db>::type, select_t> const
auto prepare(Db& db) const
-> prepared_select_t<typename std::decay<Db>::type, select_t>
{
static_assert(not vendor::is_noop<ExpressionList>::value, "cannot run select without having selected anything");
static_assert(is_from_t<From>::value, "cannot run select without a from()");

View File

@ -140,7 +140,7 @@ namespace sqlpp
return _parameter_list_t::size::value;
}
size_t _get_no_of_parameters()
size_t _get_no_of_parameters() const
{
return _parameter_list_t::size::value; // FIXME: Need to add dynamic parameters here
}
@ -154,7 +154,7 @@ namespace sqlpp
}
template<typename Db>
auto prepare(Db& db)
auto prepare(Db& db) const
-> prepared_update_t<typename std::decay<Db>::type, update_t>
{
static_assert(not vendor::is_noop<Assignments>::value, "calling set() required before running update");

View File

@ -78,7 +78,7 @@ namespace sqlpp
{
using _is_insert_list = std::true_type;
using _is_dynamic = typename std::conditional<std::is_same<Database, void>::value, std::false_type, std::true_type>::type;
using _parameter_tuple_t = std::tuple<typename Assignments::value_type...>;
using _parameter_tuple_t = std::tuple<Assignments...>;
// check for at least one order expression
static_assert(_is_dynamic::value or sizeof...(Assignments), "at least one select expression required in set()");
@ -116,7 +116,7 @@ namespace sqlpp
std::tuple<insert_column_t<typename Assignments::column_type>...> _columns;
_parameter_tuple_t _values;
std::tuple<typename Assignments::value_type...> _values;
typename vendor::interpretable_list_t<Database> _dynamic_columns;
typename vendor::interpretable_list_t<Database> _dynamic_values;
};