From 3efae18e081d2e2634a54d5da573298c00e1a3c9 Mon Sep 17 00:00:00 2001 From: rbock Date: Wed, 23 Dec 2015 14:45:40 +0100 Subject: [PATCH] Friendlier error messages for some case-expressions --- include/sqlpp11/case.h | 2 +- include/sqlpp11/no_value.h | 3 ++- include/sqlpp11/type_traits.h | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/include/sqlpp11/case.h b/include/sqlpp11/case.h index c16151e1..11877fca 100644 --- a/include/sqlpp11/case.h +++ b/include/sqlpp11/case.h @@ -55,7 +55,7 @@ namespace sqlpp struct case_t : public expression_operators< case_t, - typename std::conditional::value, value_type_of, value_type_of>::type>, + typename std::conditional::value, value_type_of, value_type_of>::type>, public alias_operators> { using _traits = make_traits, tag::is_expression>; diff --git a/include/sqlpp11/no_value.h b/include/sqlpp11/no_value.h index 68c842dc..15703d0e 100644 --- a/include/sqlpp11/no_value.h +++ b/include/sqlpp11/no_value.h @@ -35,7 +35,8 @@ namespace sqlpp { struct no_value_t { - using _traits = make_traits; + using _traits = make_traits; + using _cpp_value_type = void; }; template diff --git a/include/sqlpp11/type_traits.h b/include/sqlpp11/type_traits.h index 83f49e16..8c978de6 100644 --- a/include/sqlpp11/type_traits.h +++ b/include/sqlpp11/type_traits.h @@ -38,12 +38,13 @@ namespace sqlpp { + struct no_value_t; namespace detail { template struct value_type_of_impl { - static_assert(wrong_t::value, "Attempting to obtain value type from type without value_type"); + using type = no_value_t; }; template