Adhere to clang-tidy warning about boolean readability

This commit is contained in:
rbock
2017-09-10 15:21:24 +02:00
parent 63b40527ee
commit a17a78c5c2
2 changed files with 8 additions and 6 deletions

View File

@@ -27,6 +27,8 @@
#ifndef SQLPP11_DATA_TYPES_BOOLEAN_OPERAND_H
#define SQLPP11_DATA_TYPES_BOOLEAN_OPERAND_H
#include <ciso646> // Required for some compilers to use aliases for boolean operators
#include <sqlpp11/type_traits.h>
#include <sqlpp11/alias_operators.h>
#include <sqlpp11/serializer.h>
@@ -59,7 +61,7 @@ namespace sqlpp
bool _is_trivial() const
{
return _t == false;
return not _t;
}
_value_t _t;

View File

@@ -43,26 +43,26 @@ namespace sqlpp
template <bool... B>
struct all
{
using type = std::is_same<logic_helper<B...>, logic_helper<(B or true)...>>;
using type = std::is_same<logic_helper<B...>, logic_helper<(B, true)...>>;
};
template <bool... B>
using all_t = std::is_same<logic_helper<B...>, logic_helper<(B or true)...>>;
using all_t = std::is_same<logic_helper<B...>, logic_helper<(B, true)...>>;
// workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2086629
template <bool... B>
struct any
{
using type =
std::integral_constant<bool, not std::is_same<logic_helper<B...>, logic_helper<(B and false)...>>::value>;
std::integral_constant<bool, not std::is_same<logic_helper<B...>, logic_helper<(B, false)...>>::value>;
};
template <bool... B>
using any_t =
std::integral_constant<bool, not std::is_same<logic_helper<B...>, logic_helper<(B and false)...>>::value>;
std::integral_constant<bool, not std::is_same<logic_helper<B...>, logic_helper<(B, false)...>>::value>;
template <bool... B>
using none_t = std::is_same<logic_helper<B...>, logic_helper<(B and false)...>>;
using none_t = std::is_same<logic_helper<B...>, logic_helper<(B, false)...>>;
template <bool>
struct not_impl;