Migrated where to portable assertions, added assertion tests to where() clause.

This commit is contained in:
rbock
2015-12-24 15:28:07 +01:00
parent 8d742e1b69
commit 899c868f5e
6 changed files with 248 additions and 66 deletions

View File

@@ -49,14 +49,14 @@ namespace
{
using CheckResult = sqlpp::check_insert_static_set_t<Assignments...>;
using ExpectedCheckResult = std::is_same<CheckResult, Assert>;
static_assert(ExpectedCheckResult::value, "Unexpected check result");
print_type_on_error<CheckResult>(ExpectedCheckResult{});
static_assert(ExpectedCheckResult::value, "Unexpected check result");
using ReturnType = decltype(insert_into(t).set(assignments...));
using ExpectedReturnType =
sqlpp::logic::all_t<Assert::value xor std::is_same<ReturnType, sqlpp::bad_statement>::value>;
static_assert(ExpectedReturnType::value, "Unexpected return type");
print_type_on_error<ReturnType>(ExpectedReturnType{});
static_assert(ExpectedReturnType::value, "Unexpected return type");
}
template <typename Assert, typename... Assignments>