Friendlier error messages for some case-expressions

This commit is contained in:
rbock
2015-12-23 14:45:40 +01:00
parent 0471d732f9
commit 3efae18e08
3 changed files with 5 additions and 3 deletions

View File

@@ -55,7 +55,7 @@ namespace sqlpp
struct case_t
: public expression_operators<
case_t<When, Then, Else>,
typename std::conditional<is_sql_null_t<Then>::value, value_type_of<When>, value_type_of<Then>>::type>,
typename std::conditional<is_sql_null_t<Then>::value, value_type_of<Else>, value_type_of<Then>>::type>,
public alias_operators<case_t<When, Then, Else>>
{
using _traits = make_traits<value_type_of<Then>, tag::is_expression>;

View File

@@ -35,7 +35,8 @@ namespace sqlpp
{
struct no_value_t
{
using _traits = make_traits<void>;
using _traits = make_traits<no_value_t>;
using _cpp_value_type = void;
};
template <typename Base>

View File

@@ -38,12 +38,13 @@
namespace sqlpp
{
struct no_value_t;
namespace detail
{
template <typename T, typename Enable = void>
struct value_type_of_impl
{
static_assert(wrong_t<value_type_of_impl>::value, "Attempting to obtain value type from type without value_type");
using type = no_value_t;
};
template <typename T>