mirror of
https://github.com/rbock/sqlpp11.git
synced 2024-11-16 04:47:18 +08:00
A few minor fixes and cleanup
This commit is contained in:
parent
b1f1de8a08
commit
c818e110b6
@ -162,7 +162,7 @@ namespace sqlpp
|
||||
return _is_null;
|
||||
}
|
||||
|
||||
bool is_trivial() const
|
||||
bool _is_trivial() const
|
||||
{
|
||||
if (not _is_valid)
|
||||
throw exception("accessing is_null in non-existing row");
|
||||
|
@ -161,7 +161,7 @@ namespace sqlpp
|
||||
return _is_null;
|
||||
}
|
||||
|
||||
bool is_trivial() const
|
||||
bool _is_trivial() const
|
||||
{
|
||||
if (not _is_valid)
|
||||
throw exception("accessing is_null in non-existing row");
|
||||
|
@ -162,7 +162,7 @@ namespace sqlpp
|
||||
return _is_null;
|
||||
}
|
||||
|
||||
bool is_trivial() const
|
||||
bool _is_trivial() const
|
||||
{
|
||||
if (not _is_valid)
|
||||
throw exception("accessing is_null in non-existing row");
|
||||
|
@ -63,7 +63,21 @@ namespace sqlpp
|
||||
{
|
||||
static bool _(const T& t)
|
||||
{
|
||||
return t.is_trivial();
|
||||
if (null_is_trivial_value_t<T>::value)
|
||||
{
|
||||
return t._is_trivial();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (t.is_null())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
return t._is_trivial();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -164,7 +164,7 @@ namespace sqlpp
|
||||
return _value_ptr == nullptr;
|
||||
}
|
||||
|
||||
bool is_trivial() const
|
||||
bool _is_trivial() const
|
||||
{
|
||||
if (not _is_valid)
|
||||
throw exception("accessing is_null in non-existing row");
|
||||
|
@ -155,8 +155,7 @@ namespace sqlpp
|
||||
auto tvin(Operand operand) -> tvin_arg_t<typename wrap_operand<Operand>::type>
|
||||
{
|
||||
using _operand_t = typename wrap_operand<Operand>::type;
|
||||
static_assert(std::is_same<_operand_t, text_operand>::value
|
||||
or not std::is_same<_operand_t, Operand>::value, "tvin() used with invalid type (only string and primitive types allowed)");
|
||||
static_assert(not std::is_same<_operand_t, Operand>::value or is_result_field_t<Operand>::value, "tvin() used with invalid type (only string and primitive types allowed)");
|
||||
return {{operand}};
|
||||
}
|
||||
|
||||
|
@ -219,7 +219,7 @@ namespace sqlpp
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
struct wrap_operand<T, typename std::enable_if<std::is_convertible<T, std::string>::value>::type>
|
||||
struct wrap_operand<T, typename std::enable_if<std::is_convertible<T, std::string>::value and not is_result_field_t<T>::value>::type>
|
||||
{
|
||||
using type = text_operand;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user