mirror of
https://github.com/bolero-MURAKAMI/Sprout
synced 2025-08-03 12:49:50 +00:00
add C++14 version is_signed, is_unsigned
This commit is contained in:
parent
b51e338b68
commit
ead65bf7fd
79 changed files with 310 additions and 114 deletions
|
@ -1,6 +1,6 @@
|
|||
/*=============================================================================
|
||||
Copyright (c) 2015 fimbul
|
||||
https://github.com/fimbul
|
||||
Copyright (c) 2011-2015 Bolero MURAKAMI
|
||||
https://github.com/bolero-MURAKAMI/Sprout
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
#include <sprout/math/not_equal_to.hpp>
|
||||
#include <sprout/type_traits/arithmetic_promote.hpp>
|
||||
#include <sprout/type_traits/enabler_if.hpp>
|
||||
#include <sprout/type_traits/std_type_traits.hpp>
|
||||
|
||||
namespace sprout {
|
||||
namespace math {
|
||||
|
@ -32,7 +33,7 @@ namespace sprout {
|
|||
typename IntType1, typename IntType2,
|
||||
typename sprout::enabler_if<
|
||||
std::is_integral<typename sprout::arithmetic_promote<IntType1, IntType2>::type>::value
|
||||
&& (std::is_unsigned<IntType1>::value == std::is_unsigned<IntType2>::value)
|
||||
&& (sprout::is_unsigned<IntType1>::value == sprout::is_unsigned<IntType2>::value)
|
||||
>::type = sprout::enabler
|
||||
>
|
||||
inline SPROUT_CONSTEXPR bool
|
||||
|
@ -43,7 +44,7 @@ namespace sprout {
|
|||
typename IntType1, typename IntType2,
|
||||
typename sprout::enabler_if<
|
||||
std::is_integral<typename sprout::arithmetic_promote<IntType1, IntType2>::type>::value
|
||||
&& std::is_signed<IntType1>::value && std::is_unsigned<IntType2>::value
|
||||
&& sprout::is_signed<IntType1>::value && sprout::is_unsigned<IntType2>::value
|
||||
>::type = sprout::enabler
|
||||
>
|
||||
inline SPROUT_CONSTEXPR bool
|
||||
|
@ -57,7 +58,7 @@ namespace sprout {
|
|||
typename IntType1, typename IntType2,
|
||||
typename sprout::enabler_if<
|
||||
std::is_integral<typename sprout::arithmetic_promote<IntType1, IntType2>::type>::value
|
||||
&& std::is_unsigned<IntType1>::value && std::is_signed<IntType2>::value
|
||||
&& sprout::is_unsigned<IntType1>::value && sprout::is_signed<IntType2>::value
|
||||
>::type = sprout::enabler
|
||||
>
|
||||
inline SPROUT_CONSTEXPR bool
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
#include <sprout/math/equal_to.hpp>
|
||||
#include <sprout/type_traits/arithmetic_promote.hpp>
|
||||
#include <sprout/type_traits/enabler_if.hpp>
|
||||
#include <sprout/type_traits/std_type_traits.hpp>
|
||||
|
||||
namespace sprout {
|
||||
namespace math {
|
||||
|
@ -32,7 +33,7 @@ namespace sprout {
|
|||
typename IntType1, typename IntType2,
|
||||
typename sprout::enabler_if<
|
||||
std::is_integral<typename sprout::arithmetic_promote<IntType1, IntType2>::type>::value
|
||||
&& (std::is_unsigned<IntType1>::value == std::is_unsigned<IntType2>::value)
|
||||
&& (sprout::is_unsigned<IntType1>::value == sprout::is_unsigned<IntType2>::value)
|
||||
>::type = sprout::enabler
|
||||
>
|
||||
inline SPROUT_CONSTEXPR bool
|
||||
|
@ -43,7 +44,7 @@ namespace sprout {
|
|||
typename IntType1, typename IntType2,
|
||||
typename sprout::enabler_if<
|
||||
std::is_integral<typename sprout::arithmetic_promote<IntType1, IntType2>::type>::value
|
||||
&& std::is_signed<IntType1>::value && std::is_unsigned<IntType2>::value
|
||||
&& sprout::is_signed<IntType1>::value && sprout::is_unsigned<IntType2>::value
|
||||
>::type = sprout::enabler
|
||||
>
|
||||
inline SPROUT_CONSTEXPR bool
|
||||
|
@ -57,7 +58,7 @@ namespace sprout {
|
|||
typename IntType1, typename IntType2,
|
||||
typename sprout::enabler_if<
|
||||
std::is_integral<typename sprout::arithmetic_promote<IntType1, IntType2>::type>::value
|
||||
&& std::is_unsigned<IntType1>::value && std::is_signed<IntType2>::value
|
||||
&& sprout::is_unsigned<IntType1>::value && sprout::is_signed<IntType2>::value
|
||||
>::type = sprout::enabler
|
||||
>
|
||||
inline SPROUT_CONSTEXPR bool
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
#include <sprout/math/not_equal_to.hpp>
|
||||
#include <sprout/type_traits/arithmetic_promote.hpp>
|
||||
#include <sprout/type_traits/enabler_if.hpp>
|
||||
#include <sprout/type_traits/std_type_traits.hpp>
|
||||
|
||||
namespace sprout {
|
||||
namespace math {
|
||||
|
@ -32,7 +33,7 @@ namespace sprout {
|
|||
typename IntType1, typename IntType2,
|
||||
typename sprout::enabler_if<
|
||||
std::is_integral<typename sprout::arithmetic_promote<IntType1, IntType2>::type>::value
|
||||
&& (std::is_unsigned<IntType1>::value == std::is_unsigned<IntType2>::value)
|
||||
&& (sprout::is_unsigned<IntType1>::value == sprout::is_unsigned<IntType2>::value)
|
||||
>::type = sprout::enabler
|
||||
>
|
||||
inline SPROUT_CONSTEXPR bool
|
||||
|
@ -43,7 +44,7 @@ namespace sprout {
|
|||
typename IntType1, typename IntType2,
|
||||
typename sprout::enabler_if<
|
||||
std::is_integral<typename sprout::arithmetic_promote<IntType1, IntType2>::type>::value
|
||||
&& std::is_signed<IntType1>::value && std::is_unsigned<IntType2>::value
|
||||
&& sprout::is_signed<IntType1>::value && sprout::is_unsigned<IntType2>::value
|
||||
>::type = sprout::enabler
|
||||
>
|
||||
inline SPROUT_CONSTEXPR bool
|
||||
|
@ -57,7 +58,7 @@ namespace sprout {
|
|||
typename IntType1, typename IntType2,
|
||||
typename sprout::enabler_if<
|
||||
std::is_integral<typename sprout::arithmetic_promote<IntType1, IntType2>::type>::value
|
||||
&& std::is_unsigned<IntType1>::value && std::is_signed<IntType2>::value
|
||||
&& sprout::is_unsigned<IntType1>::value && sprout::is_signed<IntType2>::value
|
||||
>::type = sprout::enabler
|
||||
>
|
||||
inline SPROUT_CONSTEXPR bool
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
#include <sprout/math/equal_to.hpp>
|
||||
#include <sprout/type_traits/arithmetic_promote.hpp>
|
||||
#include <sprout/type_traits/enabler_if.hpp>
|
||||
#include <sprout/type_traits/std_type_traits.hpp>
|
||||
|
||||
namespace sprout {
|
||||
namespace math {
|
||||
|
@ -32,7 +33,7 @@ namespace sprout {
|
|||
typename IntType1, typename IntType2,
|
||||
typename sprout::enabler_if<
|
||||
std::is_integral<typename sprout::arithmetic_promote<IntType1, IntType2>::type>::value
|
||||
&& (std::is_unsigned<IntType1>::value == std::is_unsigned<IntType2>::value)
|
||||
&& (sprout::is_unsigned<IntType1>::value == sprout::is_unsigned<IntType2>::value)
|
||||
>::type = sprout::enabler
|
||||
>
|
||||
inline SPROUT_CONSTEXPR bool
|
||||
|
@ -43,7 +44,7 @@ namespace sprout {
|
|||
typename IntType1, typename IntType2,
|
||||
typename sprout::enabler_if<
|
||||
std::is_integral<typename sprout::arithmetic_promote<IntType1, IntType2>::type>::value
|
||||
&& std::is_signed<IntType1>::value && std::is_unsigned<IntType2>::value
|
||||
&& sprout::is_signed<IntType1>::value && sprout::is_unsigned<IntType2>::value
|
||||
>::type = sprout::enabler
|
||||
>
|
||||
inline SPROUT_CONSTEXPR bool
|
||||
|
@ -57,7 +58,7 @@ namespace sprout {
|
|||
typename IntType1, typename IntType2,
|
||||
typename sprout::enabler_if<
|
||||
std::is_integral<typename sprout::arithmetic_promote<IntType1, IntType2>::type>::value
|
||||
&& std::is_unsigned<IntType1>::value && std::is_signed<IntType2>::value
|
||||
&& sprout::is_unsigned<IntType1>::value && sprout::is_signed<IntType2>::value
|
||||
>::type = sprout::enabler
|
||||
>
|
||||
inline SPROUT_CONSTEXPR bool
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue