From 3e008a2b04078490e9a09fabc2b8eed758507c49 Mon Sep 17 00:00:00 2001 From: rbock Date: Wed, 6 Apr 2016 10:16:35 +0200 Subject: [PATCH] Intermediate state --- include/sqlpp11/basic_expression_operators.h | 51 +++++----- .../data_types/floating_point/result_field.h | 1 - test_serializer/In.cpp | 7 +- test_static_asserts/CMakeLists.txt | 2 + test_static_asserts/date.cpp | 21 +++-- test_static_asserts/date_time.cpp | 21 +++-- test_static_asserts/no_self_compare.cpp | 74 +++++++++++++++ test_static_asserts/text.cpp | 93 +++++++++++++++++++ tests/SelectType.cpp | 3 +- tests/Update.cpp | 2 +- 10 files changed, 222 insertions(+), 53 deletions(-) create mode 100644 test_static_asserts/no_self_compare.cpp create mode 100644 test_static_asserts/text.cpp diff --git a/include/sqlpp11/basic_expression_operators.h b/include/sqlpp11/basic_expression_operators.h index 23dd5b6c..665de9fb 100644 --- a/include/sqlpp11/basic_expression_operators.h +++ b/include/sqlpp11/basic_expression_operators.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2015, Roland Bock + * Copyright (c) 2013-2016, Roland Bock * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, @@ -41,10 +41,11 @@ namespace sqlpp { - SQLPP_PORTABLE_STATIC_ASSERT(assert_valid_rhs_comparison_operand_t, "invalid rhs operand in comparison"); + SQLPP_PORTABLE_STATIC_ASSERT(assert_comparison_valid_rhs_operand_t, "invalid rhs operand in comparison"); + SQLPP_PORTABLE_STATIC_ASSERT(assert_comparison_lhs_rhs_differ_t, "identical lhs and rhs operand types in comparison"); - template - using check_rhs_comparison_operand_t = + template + using check_rhs_comparison_operand_t = static_combined_check_t< static_check_t<(is_expression_t>::value // expressions are OK or is_multi_expression_t>::value) // multi-expressions like ANY are @@ -52,14 +53,12 @@ namespace sqlpp and LhsValueType::template _is_valid_operand< sqlpp::wrap_operand_t>::value, // the correct value type is required, of course - assert_valid_rhs_comparison_operand_t>; + assert_comparison_valid_rhs_operand_t>, + static_check_t::value, assert_comparison_lhs_rhs_differ_t>>; - SQLPP_PORTABLE_STATIC_ASSERT(assert_valid_in_arguments_t, "at least one operand of in() is not valid"); - - template + template using check_rhs_in_arguments_t = - static_check_t::value...>::value, - assert_valid_in_arguments_t>; + static_combined_check_t...>; namespace detail { @@ -118,7 +117,7 @@ namespace sqlpp { template