From 2dcd2918d338edd579476147052bfdf473c8654b Mon Sep 17 00:00:00 2001 From: rbock Date: Wed, 27 Aug 2014 22:53:22 +0200 Subject: [PATCH] Added operators to the 'like' member_t --- include/sqlpp11/like.h | 2 ++ tests/ResultTest.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/include/sqlpp11/like.h b/include/sqlpp11/like.h index 061e9789..d20d8691 100644 --- a/include/sqlpp11/like.h +++ b/include/sqlpp11/like.h @@ -51,6 +51,8 @@ namespace sqlpp struct _member_t { T like; + T& operator()() { return like; } + const T& operator()() const { return like; } }; }; diff --git a/tests/ResultTest.cpp b/tests/ResultTest.cpp index 7add38fa..21ca2f82 100644 --- a/tests/ResultTest.cpp +++ b/tests/ResultTest.cpp @@ -43,7 +43,7 @@ int main() static_assert(not sqlpp::null_is_trivial_value_t::value, "t.alpha does not say null_is_trivial"); // 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::value, "row.alpha can be null"); static_assert(sqlpp::null_is_trivial_value_t::value, "row.alpha interprets null_is_trivial");