mirror of
https://github.com/rbock/sqlpp11.git
synced 2024-11-16 04:47:18 +08:00
Shortened template for pseudo_column
This commit is contained in:
parent
5f927572cf
commit
56e34dbf5e
@ -32,14 +32,14 @@
|
|||||||
namespace sqlpp
|
namespace sqlpp
|
||||||
{
|
{
|
||||||
// provide type information for sub-selects that are used as named expressions or tables
|
// provide type information for sub-selects that are used as named expressions or tables
|
||||||
template<typename Expr>
|
template<typename ValueType, typename NameType>
|
||||||
struct select_column_spec_t
|
struct select_column_spec_t
|
||||||
{
|
{
|
||||||
using _traits = make_traits<value_type_of<Expr>>;
|
using _traits = make_traits<ValueType>;
|
||||||
using _recursive_traits = make_recursive_traits<>;
|
using _recursive_traits = make_recursive_traits<>;
|
||||||
using _value_type = value_type_of<Expr>; // FIXME: column specs probably should use _traits, too
|
using _value_type = ValueType; // FIXME: column specs probably should use _traits, too
|
||||||
|
|
||||||
using _name_t = typename Expr::_name_t;
|
using _name_t = NameType;
|
||||||
struct _column_type
|
struct _column_type
|
||||||
{
|
{
|
||||||
using _must_not_insert = std::true_type;
|
using _must_not_insert = std::true_type;
|
||||||
@ -53,7 +53,7 @@ namespace sqlpp
|
|||||||
>
|
>
|
||||||
struct select_pseudo_table_t: public sqlpp::table_t<select_pseudo_table_t<
|
struct select_pseudo_table_t: public sqlpp::table_t<select_pseudo_table_t<
|
||||||
Select,
|
Select,
|
||||||
NamedExpr...>, select_column_spec_t<NamedExpr>...>
|
NamedExpr...>, select_column_spec_t<value_type_of<NamedExpr>, typename NamedExpr::_name_t>...>
|
||||||
{
|
{
|
||||||
using _traits = make_traits<no_value_t, tag::table, tag::pseudo_table>;
|
using _traits = make_traits<no_value_t, tag::table, tag::pseudo_table>;
|
||||||
using _recursive_traits = make_recursive_traits<>;
|
using _recursive_traits = make_recursive_traits<>;
|
||||||
|
Loading…
Reference in New Issue
Block a user