From 4ea28cac4b8c88a9e33da07ed2718c1876bbbc5f Mon Sep 17 00:00:00 2001 From: Roland Bock Date: Thu, 15 Aug 2013 11:54:20 +0200 Subject: [PATCH] Added support for g++-4.8 --- README.md | 9 ++++++--- include/sqlpp11/insert.h | 2 +- include/sqlpp11/multi_column.h | 2 +- include/sqlpp11/remove.h | 2 +- include/sqlpp11/select.h | 10 +++++----- include/sqlpp11/update.h | 2 +- 6 files changed, 15 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 5993deb2..4b9952ce 100644 --- a/README.md +++ b/README.md @@ -78,11 +78,14 @@ db.run(remove_from(foo).where(not foo.hasFun)); Requirements: ------------- -sqlpp11 makes heavy use of C++11. It has been developed using +__Compiler:__ +sqlpp11 makes heavy use of C++11 and requires a recent compiler and STL. The following compilers are known to compile the test programs: -clang-3.2 on Ubuntu-10.4 with matching libc++ + * clang-3.2 on Ubuntu-12.4 + * g++-4.8 on Ubuntu-12.4 -It also requires a database library with a matching interface, see database/api.h +__Database Connector:__ +sqlpp11 requires a certain api in order to connect with the database, see database/api.h. Links to sample implementations will follow soon. diff --git a/include/sqlpp11/insert.h b/include/sqlpp11/insert.h index 70f2fd71..b14dbdcb 100644 --- a/include/sqlpp11/insert.h +++ b/include/sqlpp11/insert.h @@ -65,7 +65,7 @@ namespace sqlpp static_assert(std::is_same::value, "cannot call set() twice"); return { _table, - {std::forward(assignment)...}, + {std::tuple::type...>{std::forward(assignment)...}}, }; } diff --git a/include/sqlpp11/multi_column.h b/include/sqlpp11/multi_column.h index a33cf69c..08e56ecc 100644 --- a/include/sqlpp11/multi_column.h +++ b/include/sqlpp11/multi_column.h @@ -73,7 +73,7 @@ namespace sqlpp template detail::make_multi_column_t multi_column(AliasProvider&& aliasProvider, NamedExpr&&... namedExpr) { - return { {std::forward(namedExpr)...}}; + return { decltype(make_expression_tuple(std::declval()...)){std::forward(namedExpr)...}}; } } diff --git a/include/sqlpp11/remove.h b/include/sqlpp11/remove.h index d4915cd7..892d465f 100644 --- a/include/sqlpp11/remove.h +++ b/include/sqlpp11/remove.h @@ -65,7 +65,7 @@ namespace sqlpp static_assert(std::is_same::value, "cannot call using() after where()"); return { _table, - {{std::forward(tab)...}}, + {std::tuple::type...>{std::forward(tab)...}}, _where }; } diff --git a/include/sqlpp11/select.h b/include/sqlpp11/select.h index 8342d7f9..7c31177f 100644 --- a/include/sqlpp11/select.h +++ b/include/sqlpp11/select.h @@ -102,7 +102,7 @@ namespace sqlpp using add_limit_t = select_t; using add_offset_t = select_t; - using result_row_t = result_row_t; + using _result_row_t = result_row_t; // Indicators using _value_type = typename std::conditional< @@ -218,7 +218,7 @@ namespace sqlpp return { _flags, _expression_list, - {{std::forward(table)...}}, + {std::tuple::type...>{std::forward
(table)...}}, _where, _group_by, _having, @@ -256,7 +256,7 @@ namespace sqlpp _expression_list, _from, _where, - {{std::forward(column)...}}, + {std::tuple::type...>{std::forward(column)...}}, _having, _order_by, _limit, @@ -294,7 +294,7 @@ namespace sqlpp _where, _group_by, _having, - {{std::forward(expr)...}}, + {std::tuple::type...>{std::forward(expr)...}}, _limit, _offset }; @@ -383,7 +383,7 @@ namespace sqlpp // Execute template - result_t run(Db& db) const + result_t run(Db& db) const { static_assert(not is_noop::value, "cannot run select without having selected anything"); static_assert(is_from_t::value, "cannot run select without a from()"); diff --git a/include/sqlpp11/update.h b/include/sqlpp11/update.h index e69ba0dc..8dac5972 100644 --- a/include/sqlpp11/update.h +++ b/include/sqlpp11/update.h @@ -64,7 +64,7 @@ namespace sqlpp static_assert(std::is_same::value, "cannot call set() twice"); return { _table, - {{std::forward(assignment)...}}, + {std::tuple::type...>{std::forward(assignment)...}}, _where, }; }