From 68f929e041250279d0d952171fa762c4f4870ba2 Mon Sep 17 00:00:00 2001 From: rbock Date: Fri, 11 Apr 2014 08:58:28 +0200 Subject: [PATCH] Removed a bunch of superfluous functions. Dispatching made some emplace_back instances obsolete. --- include/sqlpp11/vendor/insert_value_list.h | 13 ------------- include/sqlpp11/vendor/interpretable_list.h | 3 --- include/sqlpp11/vendor/select_column_list.h | 4 ---- include/sqlpp11/vendor/update_list.h | 8 -------- tests/SelectTest.cpp | 2 -- 5 files changed, 30 deletions(-) diff --git a/include/sqlpp11/vendor/insert_value_list.h b/include/sqlpp11/vendor/insert_value_list.h index dd77859a..550061ce 100644 --- a/include/sqlpp11/vendor/insert_value_list.h +++ b/include/sqlpp11/vendor/insert_value_list.h @@ -87,19 +87,6 @@ namespace sqlpp insert_list_t& operator=(insert_list_t&&) = default; ~insert_list_t() = default; - template - void add_set(const Insert&, Assignment assignment) - { - static_assert(is_assignment_t::value, "add_set() arguments require to be assigments"); - static_assert(not must_not_insert_t::value, "add_set() argument must not be used in insert"); - using _column_table_set = typename Assignment::_column_t::_table_set; - using _value_table_set = typename Assignment::value_type::_table_set; - static_assert(::sqlpp::detail::is_subset_of<_value_table_set, typename Insert::_table_set>::value, "add_set() contains a column from a foreign table"); - static_assert(::sqlpp::detail::is_subset_of<_column_table_set, typename Insert::_table_set>::value, "add_set() contains a value from a foreign table"); - _dynamic_columns.emplace_back(simple_column_t{assignment._lhs}); - _dynamic_values.emplace_back(assignment._rhs); - } - template struct _methods_t { diff --git a/include/sqlpp11/vendor/interpretable_list.h b/include/sqlpp11/vendor/interpretable_list.h index 291b8123..a6b2d27e 100644 --- a/include/sqlpp11/vendor/interpretable_list.h +++ b/include/sqlpp11/vendor/interpretable_list.h @@ -60,9 +60,6 @@ namespace sqlpp template<> struct interpretable_list_t { - template - void emplace_back(const T&) {} - static constexpr std::size_t size() { return 0; diff --git a/include/sqlpp11/vendor/select_column_list.h b/include/sqlpp11/vendor/select_column_list.h index 6478799e..a44a586e 100644 --- a/include/sqlpp11/vendor/select_column_list.h +++ b/include/sqlpp11/vendor/select_column_list.h @@ -89,10 +89,6 @@ namespace sqlpp }; _names_t _dynamic_expression_names; -#warning: Put an assert here or remove implementation to make sure this never aktually gets called - template - void emplace_back(const T&) {} - static constexpr bool empty() { return true; diff --git a/include/sqlpp11/vendor/update_list.h b/include/sqlpp11/vendor/update_list.h index 9cd560d9..a670c422 100644 --- a/include/sqlpp11/vendor/update_list.h +++ b/include/sqlpp11/vendor/update_list.h @@ -68,14 +68,6 @@ namespace sqlpp update_list_t& operator=(update_list_t&&) = default; ~update_list_t() = default; - template - void add_set(const Update&, Assignment assignment) - { - static_assert(is_assignment_t::value, "set() arguments require to be assigments"); - static_assert(not must_not_update_t::value, "set() argument must not be updated"); - _dynamic_assignments.emplace_back(assignment); - } - template struct _methods_t { diff --git a/tests/SelectTest.cpp b/tests/SelectTest.cpp index 8880da29..6dd02b46 100644 --- a/tests/SelectTest.cpp +++ b/tests/SelectTest.cpp @@ -49,7 +49,6 @@ int main() test::TabFoo f; test::TabBar t; - /* for (const auto& row : db(select(all_of(t)).from(t).where(true))) { int64_t a = row.alpha; @@ -68,7 +67,6 @@ int main() const std::string b = row.tabBar.beta; const bool g = row.gamma; } - */ auto s = dynamic_select(db).dynamic_columns(t.alpha).dynamic_flags().dynamic_from(t).dynamic_where().dynamic_group_by(t.alpha).dynamic_order_by().dynamic_having(t.gamma).dynamic_limit().dynamic_offset(); s.add_flag(sqlpp::distinct);