mirror of
https://github.com/rbock/sqlpp11.git
synced 2024-11-15 20:31:16 +08:00
Fixed compile error for clang-3.4 and gcc-4.8
This commit is contained in:
parent
8886551d04
commit
34376bdd28
@ -43,6 +43,16 @@ namespace sqlpp
|
|||||||
|
|
||||||
using _alias_t = typename AliasProvider::_alias_t;
|
using _alias_t = typename AliasProvider::_alias_t;
|
||||||
|
|
||||||
|
expression_alias_t(Expression expression):
|
||||||
|
_expression(expression)
|
||||||
|
{}
|
||||||
|
|
||||||
|
expression_alias_t(const expression_alias_t&) = default;
|
||||||
|
expression_alias_t(expression_alias_t&&) = default;
|
||||||
|
expression_alias_t& operator=(const expression_alias_t&) = default;
|
||||||
|
expression_alias_t& operator=(expression_alias_t&&) = default;
|
||||||
|
~expression_alias_t() = default;
|
||||||
|
|
||||||
Expression _expression;
|
Expression _expression;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -40,7 +40,7 @@ namespace sqlpp
|
|||||||
template<typename T>
|
template<typename T>
|
||||||
struct as_column_tuple
|
struct as_column_tuple
|
||||||
{
|
{
|
||||||
static std::tuple<auto_alias_t<T>> _(T t) { return std::tuple<auto_alias_t<T>>{ auto_alias_t<T>{t} }; }
|
static std::tuple<auto_alias_t<T>> _(T t) { return std::tuple<auto_alias_t<T>>(auto_alias_t<T>{t}); }
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
@ -70,6 +70,12 @@ namespace sqlpp
|
|||||||
template<template<typename First, typename...> class Target, typename First, typename T>
|
template<template<typename First, typename...> class Target, typename First, typename T>
|
||||||
using copy_tuple_args_t = typename copy_tuple_args_impl<Target, First, T>::type;
|
using copy_tuple_args_t = typename copy_tuple_args_impl<Target, First, T>::type;
|
||||||
|
|
||||||
|
template<typename... Columns>
|
||||||
|
auto column_tuple_merge(Columns... columns) -> decltype(std::tuple_cat(as_column_tuple<Columns>::_(columns)...))
|
||||||
|
{
|
||||||
|
return std::tuple_cat(as_column_tuple<Columns>::_(columns)...);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -129,8 +129,8 @@ namespace sqlpp
|
|||||||
{
|
{
|
||||||
template<typename... Columns>
|
template<typename... Columns>
|
||||||
using make_multi_column_t =
|
using make_multi_column_t =
|
||||||
detail::copy_tuple_args_t<multi_column_t, void,
|
copy_tuple_args_t<multi_column_t, void,
|
||||||
decltype(std::tuple_cat(detail::as_column_tuple<Columns>::_(std::declval<Columns>())...))>;
|
decltype(column_tuple_merge(std::declval<Columns>()...))>;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename... Columns>
|
template<typename... Columns>
|
||||||
|
@ -338,17 +338,10 @@ namespace sqlpp
|
|||||||
|
|
||||||
namespace detail
|
namespace detail
|
||||||
{
|
{
|
||||||
template<typename... Columns>
|
|
||||||
auto column_tuple_merge(Columns... columns) -> decltype(std::tuple_cat(as_column_tuple<Columns>::_(columns)...))
|
|
||||||
{
|
|
||||||
return std::tuple_cat(as_column_tuple<Columns>::_(columns)...);
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename Database, typename... Columns>
|
template<typename Database, typename... Columns>
|
||||||
using make_select_column_list_t =
|
using make_select_column_list_t =
|
||||||
copy_tuple_args_t<select_column_list_t, Database,
|
copy_tuple_args_t<select_column_list_t, Database,
|
||||||
decltype(column_tuple_merge(std::declval<Columns>()...))>;
|
decltype(column_tuple_merge(std::declval<Columns>()...))>;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
struct no_select_column_list_t
|
struct no_select_column_list_t
|
||||||
|
@ -36,6 +36,7 @@ int Interpret(int, char**)
|
|||||||
|
|
||||||
test::TabFoo f;
|
test::TabFoo f;
|
||||||
test::TabBar t;
|
test::TabBar t;
|
||||||
|
select(t.alpha.as(t.beta));
|
||||||
|
|
||||||
serialize(insert_into(t).columns(t.beta, t.gamma), printer).str();
|
serialize(insert_into(t).columns(t.beta, t.gamma), printer).str();
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user