diff --git a/include/sqlpp11/result_row.h b/include/sqlpp11/result_row.h index 883065e3..bebe78dd 100644 --- a/include/sqlpp11/result_row.h +++ b/include/sqlpp11/result_row.h @@ -186,19 +186,6 @@ namespace sqlpp using _impl = detail::result_row_impl; bool _is_valid; - template - static constexpr auto is_compatible(detail::type_vector>) -> - typename std::enable_if::type - { - return logic::all_t::value; - } - - template - static constexpr auto is_compatible(detail::type_vector>) -> - typename std::enable_if::type - { - return false; - } result_row_t() : _impl(), _is_valid(false) { } @@ -264,6 +251,20 @@ namespace sqlpp } }; + template + struct is_result_compatible + { + static constexpr auto value = false; + }; + + template + struct is_result_compatible, + result_row_t, + typename std::enable_if::type> + { + static constexpr auto value = logic::all_t::value; + }; + template struct dynamic_result_row_t : public detail::result_row_impl, FieldSpecs...> diff --git a/include/sqlpp11/union.h b/include/sqlpp11/union.h index 6a3920f1..624e5ff2 100644 --- a/include/sqlpp11/union.h +++ b/include/sqlpp11/union.h @@ -215,8 +215,7 @@ namespace sqlpp using lhs_result_row_t = get_result_row_t>; using rhs_result_row_t = get_result_row_t; - constexpr auto vec_rhs = detail::type_vector{}; - static_assert(lhs_result_row_t::is_compatible(vec_rhs), + static_assert(is_result_compatible::value, "both arguments in a union have to have the same result columns (type and name)"); return _union_impl(check_union_t, Rhs>{}, rhs); @@ -234,8 +233,7 @@ namespace sqlpp using lhs_result_row_t = get_result_row_t>; using rhs_result_row_t = get_result_row_t; - constexpr auto vec_rhs = detail::type_vector{}; - static_assert(lhs_result_row_t::is_compatible(vec_rhs), + static_assert(is_result_compatible::value, "both arguments in a union have to have the same result columns (type and name)"); return _union_impl(check_union_t, Rhs>{}, rhs);