From fae1f08d937e188efd7198e0403a2c151b2d26b0 Mon Sep 17 00:00:00 2001 From: rbock Date: Sat, 31 Oct 2015 11:03:20 +0100 Subject: [PATCH] Added storage type to parameter_value_base struct This allows to store bool as signed char, the latter being the usual data type in connector libraries afaict --- include/sqlpp11/data_types/boolean/parameter_type.h | 4 ++-- include/sqlpp11/data_types/parameter_value_base.h | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/include/sqlpp11/data_types/boolean/parameter_type.h b/include/sqlpp11/data_types/boolean/parameter_type.h index 2e00b1b3..728140d2 100644 --- a/include/sqlpp11/data_types/boolean/parameter_type.h +++ b/include/sqlpp11/data_types/boolean/parameter_type.h @@ -35,9 +35,9 @@ namespace sqlpp { template <> - struct parameter_value_t : public base_parameter_value + struct parameter_value_t : public base_parameter_value { - using base = base_parameter_value; + using base = base_parameter_value; using base::base; using base::operator=; diff --git a/include/sqlpp11/data_types/parameter_value_base.h b/include/sqlpp11/data_types/parameter_value_base.h index 6c55be4e..19785d62 100644 --- a/include/sqlpp11/data_types/parameter_value_base.h +++ b/include/sqlpp11/data_types/parameter_value_base.h @@ -32,11 +32,12 @@ namespace sqlpp { - template + template struct base_parameter_value { using _value_type = DataType; using _cpp_value_type = typename _value_type::_cpp_value_type; + using _cpp_storage_type = StorageType; base_parameter_value() : _value{}, _is_null{true} { @@ -90,7 +91,7 @@ namespace sqlpp } protected: - _cpp_value_type _value; + _cpp_storage_type _value; bool _is_null; }; }