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

Added operators to the 'like' member_t

This commit is contained in:
rbock 2014-08-27 22:53:22 +02:00
parent d75862365b
commit 2dcd2918d3
2 changed files with 3 additions and 1 deletions

View File

@ -51,6 +51,8 @@ namespace sqlpp
struct _member_t struct _member_t
{ {
T like; T like;
T& operator()() { return like; }
const T& operator()() const { return like; }
}; };
}; };

View File

@ -43,7 +43,7 @@ int main()
static_assert(not sqlpp::null_is_trivial_value_t<decltype(t.alpha)>::value, "t.alpha does not say null_is_trivial"); static_assert(not sqlpp::null_is_trivial_value_t<decltype(t.alpha)>::value, "t.alpha does not say null_is_trivial");
// Using a non-enforcing db // Using a non-enforcing db
for (const auto& row : db(select(all_of(t)).from(t).where(true))) for (const auto& row : db(select(all_of(t), t.beta.like("")).from(t).where(true)))
{ {
static_assert(sqlpp::can_be_null_t<decltype(row.alpha)>::value, "row.alpha can be null"); static_assert(sqlpp::can_be_null_t<decltype(row.alpha)>::value, "row.alpha can be null");
static_assert(sqlpp::null_is_trivial_value_t<decltype(row.alpha)>::value, "row.alpha interprets null_is_trivial"); static_assert(sqlpp::null_is_trivial_value_t<decltype(row.alpha)>::value, "row.alpha interprets null_is_trivial");