0
0
mirror of https://github.com/rbock/sqlpp11.git synced 2024-11-16 04:47:18 +08:00
Commit Graph

4 Commits

Author SHA1 Message Date
Roland Bock
161da75723 Stripped a lot of superfluouos type information from result rows.
Moved member template into name class to utilize the fact the class
aliases are really just aliases.
This makes the code leaner in many cases and less complex for the compiler
(I guess). It also has the benefit, that the field name is available as
string in the result_rows. This might be useful for debugging one day.
2013-09-13 09:18:15 +02:00
Roland Bock
2defeff18e Introduced field template to make result_row_t less specific.
It is sufficient to have name and type. There is no need for the result
"to know" what exact expression was used to define the column.

Surprisingly, template alias creates new templates (in contrast to
non-template using, which really just creates an alias of a type).

template<typename T> struct A{};

struct X
{
  template<typename T>
    using U = A<T>;
};

struct Y
{
  template<typename T>
    using U = A<T>;
  template<>
    using U<int> = X;
};

template<template<typename> class X>
struct Z{};

static_assert(std::is_same<X::U<int>, Y::U<int>>::value, "class aliases are really just aliases");
static_assert(not std::is_same<Z<X::U>, Z<Y::U>>::value, "template aliases are new templates");

int main()
{
}
2013-09-13 07:24:41 +02:00
Roland Bock
f39582082b Minor cleanup 2013-08-17 11:27:41 +02:00
Roland Bock
712d3a5c53 Renamed examples -> tests
Will need to add reasonable examples
2013-08-17 11:22:38 +02:00