add C++14 version is_signed, is_unsigned

This commit is contained in:
bolero-MURAKAMI 2015-03-31 20:05:32 +09:00
parent b51e338b68
commit ead65bf7fd
79 changed files with 310 additions and 114 deletions

View file

@ -1,6 +1,8 @@
/*=============================================================================
Copyright (c) 2011 RiSK (sscrisk)
https://github.com/sscrisk/CEL---ConstExpr-Library
Copyright (c) 2011-2015 Bolero MURAKAMI
Copyright (C) 2011 RiSK (sscrisk)
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying

View file

@ -1,6 +1,8 @@
/*=============================================================================
Copyright (c) 2011 RiSK (sscrisk)
https://github.com/sscrisk/CEL---ConstExpr-Library
Copyright (c) 2011-2015 Bolero MURAKAMI
Copyright (C) 2011 RiSK (sscrisk)
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying

View file

@ -1,6 +1,8 @@
/*=============================================================================
Copyright (c) 2011 RiSK (sscrisk)
https://github.com/sscrisk/CEL---ConstExpr-Library
Copyright (c) 2011-2015 Bolero MURAKAMI
Copyright (C) 2011 RiSK (sscrisk)
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying

View file

@ -55,7 +55,7 @@ namespace sprout {
InputIterator1 last1, InputIterator2 last2, Compare comp, typename std::iterator_traits<InputIterator1>::difference_type n
)
{
return sprout::tuples::get<2>(current) || sprout::tuples::get<0>(current) == last1 || sprout::tuples::get<1>(current) == last2 ? current
return sprout::tuples::get<2>(current) || sprout::tuples::get<0>(current) == last1 ? current
: sprout::detail::find_symmetric_difference_impl(
sprout::detail::find_symmetric_difference_impl_1(
current,

View file

@ -1,6 +1,8 @@
/*=============================================================================
Copyright (c) 2011 RiSK (sscrisk)
https://github.com/sscrisk/CEL---ConstExpr-Library
Copyright (c) 2011-2015 Bolero MURAKAMI
Copyright (C) 2011 RiSK (sscrisk)
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying

View file

@ -1,6 +1,8 @@
/*=============================================================================
Copyright (c) 2011 RiSK (sscrisk)
https://github.com/sscrisk/CEL---ConstExpr-Library
Copyright (c) 2011-2015 Bolero MURAKAMI
Copyright (C) 2011 RiSK (sscrisk)
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying

View file

@ -1,6 +1,8 @@
/*=============================================================================
Copyright (c) 2011 RiSK (sscrisk)
https://github.com/sscrisk/CEL---ConstExpr-Library
Copyright (c) 2011-2015 Bolero MURAKAMI
Copyright (C) 2011 RiSK (sscrisk)
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying

View file

@ -1,6 +1,8 @@
/*=============================================================================
Copyright (c) 2011 RiSK (sscrisk)
https://github.com/sscrisk/CEL---ConstExpr-Library
Copyright (c) 2011-2015 Bolero MURAKAMI
Copyright (C) 2011 RiSK (sscrisk)
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying

View file

@ -1,6 +1,8 @@
/*=============================================================================
Copyright (c) 2011 RiSK (sscrisk)
https://github.com/sscrisk/CEL---ConstExpr-Library
Copyright (c) 2011-2015 Bolero MURAKAMI
Copyright (C) 2011 RiSK (sscrisk)
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying

View file

@ -1,6 +1,8 @@
/*=============================================================================
Copyright (c) 2011 RiSK (sscrisk)
https://github.com/sscrisk/CEL---ConstExpr-Library
Copyright (c) 2011-2015 Bolero MURAKAMI
Copyright (C) 2011 RiSK (sscrisk)
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying

View file

@ -1,6 +1,8 @@
/*=============================================================================
Copyright (c) 2011 RiSK (sscrisk)
https://github.com/sscrisk/CEL---ConstExpr-Library
Copyright (c) 2011-2015 Bolero MURAKAMI
Copyright (C) 2011 RiSK (sscrisk)
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying

View file

@ -1,6 +1,8 @@
/*=============================================================================
Copyright (c) 2011 RiSK (sscrisk)
https://github.com/sscrisk/CEL---ConstExpr-Library
Copyright (c) 2011-2015 Bolero MURAKAMI
Copyright (C) 2011 RiSK (sscrisk)
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying

View file

@ -10,6 +10,7 @@
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/type_traits/std_type_traits.hpp>
namespace sprout {
namespace detail {
@ -29,7 +30,7 @@ namespace sprout {
# endif
template<typename T>
inline SPROUT_CONSTEXPR typename std::enable_if<
std::is_unsigned<T>::value,
sprout::is_unsigned<T>::value,
int
>::type
popcount(T n) {
@ -39,7 +40,7 @@ namespace sprout {
}
template<typename T>
inline SPROUT_CONSTEXPR typename std::enable_if<
std::is_signed<T>::value,
sprout::is_signed<T>::value,
int
>::type
popcount(T n) {

View file

@ -1,6 +1,8 @@
/*=============================================================================
Copyright (c) 2011 RiSK (sscrisk)
https://github.com/sscrisk/CEL---ConstExpr-Library
Copyright (c) 2011-2015 Bolero MURAKAMI
Copyright (C) 2011 RiSK (sscrisk)
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying
@ -11,6 +13,7 @@
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/type_traits/std_type_traits.hpp>
namespace sprout {
@ -43,7 +46,7 @@ namespace sprout {
namespace {
template<typename IntType>
inline SPROUT_CONSTEXPR typename std::enable_if<
std::is_integral<IntType>::value && std::is_signed<IntType>::value,
std::is_integral<IntType>::value && sprout::is_signed<IntType>::value,
IntType
>::type
abs(IntType j) {
@ -52,7 +55,7 @@ namespace sprout {
template<typename IntType>
inline SPROUT_CONSTEXPR typename std::enable_if<
std::is_integral<IntType>::value && std::is_unsigned<IntType>::value,
std::is_integral<IntType>::value && sprout::is_unsigned<IntType>::value,
IntType
>::type
abs(IntType j) {

View file

@ -12,6 +12,7 @@
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/limits.hpp>
#include <sprout/type_traits/std_type_traits.hpp>
#include <sprout/iterator/operation.hpp>
#include <sprout/ctype/ascii.hpp>
#include <sprout/detail/char_literal.hpp>
@ -39,7 +40,7 @@ namespace sprout {
}
template<typename IntType, typename NullTerminatedIterator>
inline SPROUT_CONSTEXPR typename std::enable_if<
std::is_unsigned<IntType>::value,
sprout::is_unsigned<IntType>::value,
IntType
>::type
ascii_to_int(NullTerminatedIterator str) {
@ -53,7 +54,7 @@ namespace sprout {
}
template<typename IntType, typename NullTerminatedIterator>
inline SPROUT_CONSTEXPR typename std::enable_if<
std::is_signed<IntType>::value,
sprout::is_signed<IntType>::value,
IntType
>::type
ascii_to_int(NullTerminatedIterator str) {

View file

@ -1,6 +1,8 @@
/*=============================================================================
Copyright (c) 2011 RiSK (sscrisk)
https://github.com/sscrisk/CEL---ConstExpr-Library
Copyright (c) 2011-2015 Bolero MURAKAMI
Copyright (C) 2011 RiSK (sscrisk)
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying

View file

@ -13,6 +13,7 @@
#include <sprout/config.hpp>
#include <sprout/workaround/std/cstddef.hpp>
#include <sprout/limits.hpp>
#include <sprout/type_traits/std_type_traits.hpp>
#include <sprout/iterator/operation.hpp>
#include <sprout/ctype/ascii.hpp>
#include <sprout/detail/char_literal.hpp>
@ -72,7 +73,7 @@ namespace sprout {
}
template<typename IntType, typename NullTerminatedIterator>
inline SPROUT_CONSTEXPR typename std::enable_if<
std::is_unsigned<IntType>::value,
sprout::is_unsigned<IntType>::value,
IntType
>::type
str_to_int(NullTerminatedIterator str, int base) {
@ -86,7 +87,7 @@ namespace sprout {
}
template<typename IntType, typename NullTerminatedIterator>
inline SPROUT_CONSTEXPR typename std::enable_if<
std::is_signed<IntType>::value,
sprout::is_signed<IntType>::value,
IntType
>::type
str_to_int(NullTerminatedIterator str, int base) {
@ -105,11 +106,11 @@ namespace sprout {
str_to_int(NullTerminatedIterator str, CharPtr* endptr, int base) {
return !endptr ? sprout::detail::str_to_int<IntType>(str, base)
#if defined(_MSC_VER)
: std::is_signed<IntType>::value
: sprout::is_signed<IntType>::value
? static_cast<IntType>(std::strtol(&*str, endptr, base))
: static_cast<IntType>(std::strtoul(&*str, endptr, base))
#elif defined(__MINGW32__)
: std::is_signed<IntType>::value
: sprout::is_signed<IntType>::value
? sizeof(IntType) <= sizeof(long) ? static_cast<IntType>(std::strtol(&*str, endptr, base))
: sizeof(IntType) <= sizeof(long long) ? static_cast<IntType>(::strtoll(&*str, endptr, base))
: static_cast<IntType>(std::strtoimax(&*str, endptr, base))
@ -117,7 +118,7 @@ namespace sprout {
: sizeof(IntType) <= sizeof(unsigned long long) ? static_cast<IntType>(::strtoull(&*str, endptr, base))
: static_cast<IntType>(std::strtoumax(&*str, endptr, base))
#else
: std::is_signed<IntType>::value
: sprout::is_signed<IntType>::value
? sizeof(IntType) <= sizeof(long) ? static_cast<IntType>(std::strtol(&*str, endptr, base))
: sizeof(IntType) <= sizeof(long long) ? static_cast<IntType>(std::strtoll(&*str, endptr, base))
: static_cast<IntType>(std::strtoimax(&*str, endptr, base))

View file

@ -1,6 +1,8 @@
/*=============================================================================
Copyright (c) 2011 RiSK (sscrisk)
https://github.com/sscrisk/CEL---ConstExpr-Library
Copyright (c) 2011-2015 Bolero MURAKAMI
Copyright (C) 2011 RiSK (sscrisk)
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying

View file

@ -1,6 +1,8 @@
/*=============================================================================
Copyright (c) 2011 RiSK (sscrisk)
https://github.com/sscrisk/CEL---ConstExpr-Library
Copyright (c) 2011-2015 Bolero MURAKAMI
Copyright (C) 2011 RiSK (sscrisk)
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying

View file

@ -1,6 +1,8 @@
/*=============================================================================
Copyright (c) 2011 RiSK (sscrisk)
https://github.com/sscrisk/CEL---ConstExpr-Library
Copyright (c) 2011-2015 Bolero MURAKAMI
Copyright (C) 2011 RiSK (sscrisk)
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying

View file

@ -1,6 +1,8 @@
/*=============================================================================
Copyright (c) 2011 RiSK (sscrisk)
https://github.com/sscrisk/CEL---ConstExpr-Library
Copyright (c) 2011-2015 Bolero MURAKAMI
Copyright (C) 2011 RiSK (sscrisk)
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying

View file

@ -1,6 +1,8 @@
/*=============================================================================
Copyright (c) 2011 RiSK (sscrisk)
https://github.com/sscrisk/CEL---ConstExpr-Library
Copyright (c) 2011-2015 Bolero MURAKAMI
Copyright (C) 2011 RiSK (sscrisk)
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying

View file

@ -1,6 +1,8 @@
/*=============================================================================
Copyright (c) 2011 RiSK (sscrisk)
https://github.com/sscrisk/CEL---ConstExpr-Library
Copyright (c) 2011-2015 Bolero MURAKAMI
Copyright (C) 2011 RiSK (sscrisk)
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying

View file

@ -1,6 +1,8 @@
/*=============================================================================
Copyright (c) 2011 RiSK (sscrisk)
https://github.com/sscrisk/CEL---ConstExpr-Library
Copyright (c) 2011-2015 Bolero MURAKAMI
Copyright (C) 2011 RiSK (sscrisk)
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying

View file

@ -15,7 +15,7 @@
#include <sprout/limits.hpp>
#include <sprout/functional/hash/hash_fwd.hpp>
#include <sprout/functional/hash/detail/hash_float.hpp>
#include <sprout/type_traits/integral_constant.hpp>
#include <sprout/type_traits/std_type_traits.hpp>
namespace sprout {
namespace hash_detail {
@ -31,7 +31,7 @@ namespace sprout {
: public sprout::bool_constant<
std::is_integral<T>::value
&& (sizeof(T) > sizeof(std::size_t))
&& std::is_signed<T>::value
&& sprout::is_signed<T>::value
>
{};
template<typename T>
@ -39,7 +39,7 @@ namespace sprout {
: public sprout::bool_constant<
std::is_integral<T>::value
&& (sizeof(T) > sizeof(std::size_t))
&& std::is_unsigned<T>::value
&& sprout::is_unsigned<T>::value
>
{};

View file

@ -1,6 +1,8 @@
/*=============================================================================
Copyright (c) 2011 RiSK (sscrisk)
https://github.com/sscrisk/CEL---ConstExpr-Library
Copyright (c) 2011-2015 Bolero MURAKAMI
Copyright (C) 2011 RiSK (sscrisk)
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying

View file

@ -1,6 +1,8 @@
/*=============================================================================
Copyright (c) 2011 RiSK (sscrisk)
https://github.com/sscrisk/CEL---ConstExpr-Library
Copyright (c) 2011-2015 Bolero MURAKAMI
Copyright (C) 2011 RiSK (sscrisk)
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying

View file

@ -1,6 +1,8 @@
/*=============================================================================
Copyright (c) 2011 RiSK (sscrisk)
https://github.com/sscrisk/CEL---ConstExpr-Library
Copyright (c) 2011-2015 Bolero MURAKAMI
Copyright (C) 2011 RiSK (sscrisk)
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying

View file

@ -1,6 +1,8 @@
/*=============================================================================
Copyright (c) 2011 RiSK (sscrisk)
https://github.com/sscrisk/CEL---ConstExpr-Library
Copyright (c) 2011-2015 Bolero MURAKAMI
Copyright (C) 2011 RiSK (sscrisk)
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying

View file

@ -1,6 +1,8 @@
/*=============================================================================
Copyright (c) 2011 RiSK (sscrisk)
https://github.com/sscrisk/CEL---ConstExpr-Library
Copyright (c) 2011-2015 Bolero MURAKAMI
Copyright (C) 2011 RiSK (sscrisk)
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying

View file

@ -1,6 +1,8 @@
/*=============================================================================
Copyright (c) 2011 RiSK (sscrisk)
https://github.com/sscrisk/CEL---ConstExpr-Library
Copyright (c) 2011-2015 Bolero MURAKAMI
Copyright (C) 2011 RiSK (sscrisk)
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying

View file

@ -1,6 +1,8 @@
/*=============================================================================
Copyright (c) 2011 RiSK (sscrisk)
https://github.com/sscrisk/CEL---ConstExpr-Library
Copyright (c) 2011-2015 Bolero MURAKAMI
Copyright (C) 2011 RiSK (sscrisk)
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying

View file

@ -1,6 +1,8 @@
/*=============================================================================
Copyright (c) 2011 RiSK (sscrisk)
https://github.com/sscrisk/CEL---ConstExpr-Library
Copyright (c) 2011-2015 Bolero MURAKAMI
Copyright (C) 2011 RiSK (sscrisk)
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying

View file

@ -1,6 +1,8 @@
/*=============================================================================
Copyright (c) 2011 RiSK (sscrisk)
https://github.com/sscrisk/CEL---ConstExpr-Library
Copyright (c) 2011-2015 Bolero MURAKAMI
Copyright (C) 2011 RiSK (sscrisk)
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying

View file

@ -12,7 +12,7 @@
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/workaround/std/cstddef.hpp>
#include <sprout/type_traits/integral_constant.hpp>
#include <sprout/type_traits/std_type_traits.hpp>
namespace sprout {
namespace detail {
@ -20,8 +20,8 @@ namespace sprout {
struct integer_digits_impl
: public sprout::integral_constant<
std::size_t,
(CHAR_BIT * sizeof(IntType) - (std::is_signed<IntType>::value ? 1 : 0)) * N / D
+ ((CHAR_BIT * sizeof(IntType) - (std::is_signed<IntType>::value ? 1 : 0)) * N % D ? 1 : 0)
(CHAR_BIT * sizeof(IntType) - (sprout::is_signed<IntType>::value ? 1 : 0)) * N / D
+ ((CHAR_BIT * sizeof(IntType) - (sprout::is_signed<IntType>::value ? 1 : 0)) * N % D ? 1 : 0)
>
{};
} // namespace detail

View file

@ -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)

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -18,9 +18,6 @@
#include <sprout/random/random_result.hpp>
#include <sprout/random/results.hpp>
#include <sprout/assert.hpp>
#ifdef SPROUT_WORKAROUND_NOT_TERMINATE_RECURSIVE_CONSTEXPR_FUNCTION_TEMPLATE
# include <sprout/workaround/recursive_function_template.hpp>
#endif
namespace sprout {
namespace random {

View file

@ -16,9 +16,6 @@
#include <sprout/random/random_result.hpp>
#include <sprout/random/results.hpp>
#include <sprout/assert.hpp>
#ifdef SPROUT_WORKAROUND_NOT_TERMINATE_RECURSIVE_CONSTEXPR_FUNCTION_TEMPLATE
# include <sprout/workaround/recursive_function_template.hpp>
#endif
namespace sprout {
namespace random {

View file

@ -1,6 +1,8 @@
/*=============================================================================
Copyright (c) 2011 RiSK (sscrisk)
https://github.com/sscrisk/CEL---ConstExpr-Library
Copyright (c) 2011-2015 Bolero MURAKAMI
Copyright (C) 2011 RiSK (sscrisk)
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying

View file

@ -1,6 +1,8 @@
/*=============================================================================
Copyright (c) 2011 RiSK (sscrisk)
https://github.com/sscrisk/CEL---ConstExpr-Library
Copyright (c) 2011-2015 Bolero MURAKAMI
Copyright (C) 2011 RiSK (sscrisk)
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying

View file

@ -1,6 +1,8 @@
/*=============================================================================
Copyright (c) 2011 RiSK (sscrisk)
https://github.com/sscrisk/CEL---ConstExpr-Library
Copyright (c) 2011-2015 Bolero MURAKAMI
Copyright (C) 2011 RiSK (sscrisk)
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying

View file

@ -1,6 +1,8 @@
/*=============================================================================
Copyright (c) 2011 RiSK (sscrisk)
https://github.com/sscrisk/CEL---ConstExpr-Library
Copyright (c) 2011-2015 Bolero MURAKAMI
Copyright (C) 2011 RiSK (sscrisk)
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying

View file

@ -1,6 +1,8 @@
/*=============================================================================
Copyright (c) 2011 RiSK (sscrisk)
https://github.com/sscrisk/CEL---ConstExpr-Library
Copyright (c) 2011-2015 Bolero MURAKAMI
Copyright (C) 2011 RiSK (sscrisk)
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying

View file

@ -1,6 +1,8 @@
/*=============================================================================
Copyright (c) 2011 RiSK (sscrisk)
https://github.com/sscrisk/CEL---ConstExpr-Library
Copyright (c) 2011-2015 Bolero MURAKAMI
Copyright (C) 2011 RiSK (sscrisk)
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying

View file

@ -1,6 +1,8 @@
/*=============================================================================
Copyright (c) 2011 RiSK (sscrisk)
https://github.com/sscrisk/CEL---ConstExpr-Library
Copyright (c) 2011-2015 Bolero MURAKAMI
Copyright (C) 2011 RiSK (sscrisk)
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying

View file

@ -1,6 +1,8 @@
/*=============================================================================
Copyright (c) 2011 RiSK (sscrisk)
https://github.com/sscrisk/CEL---ConstExpr-Library
Copyright (c) 2011-2015 Bolero MURAKAMI
Copyright (C) 2011 RiSK (sscrisk)
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying

View file

@ -1,6 +1,8 @@
/*=============================================================================
Copyright (c) 2011 RiSK (sscrisk)
https://github.com/sscrisk/CEL---ConstExpr-Library
Copyright (c) 2011-2015 Bolero MURAKAMI
Copyright (C) 2011 RiSK (sscrisk)
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying

View file

@ -1,6 +1,8 @@
/*=============================================================================
Copyright (c) 2011 RiSK (sscrisk)
https://github.com/sscrisk/CEL---ConstExpr-Library
Copyright (c) 2011-2015 Bolero MURAKAMI
Copyright (C) 2011 RiSK (sscrisk)
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying

View file

@ -1,6 +1,8 @@
/*=============================================================================
Copyright (c) 2011 RiSK (sscrisk)
https://github.com/sscrisk/CEL---ConstExpr-Library
Copyright (c) 2011-2015 Bolero MURAKAMI
Copyright (C) 2011 RiSK (sscrisk)
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying

View file

@ -1,6 +1,8 @@
/*=============================================================================
Copyright (c) 2011 RiSK (sscrisk)
https://github.com/sscrisk/CEL---ConstExpr-Library
Copyright (c) 2011-2015 Bolero MURAKAMI
Copyright (C) 2011 RiSK (sscrisk)
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying

View file

@ -1,6 +1,8 @@
/*=============================================================================
Copyright (c) 2011 RiSK (sscrisk)
https://github.com/sscrisk/CEL---ConstExpr-Library
Copyright (c) 2011-2015 Bolero MURAKAMI
Copyright (C) 2011 RiSK (sscrisk)
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying

View file

@ -1,6 +1,8 @@
/*=============================================================================
Copyright (c) 2011 RiSK (sscrisk)
https://github.com/sscrisk/CEL---ConstExpr-Library
Copyright (c) 2011-2015 Bolero MURAKAMI
Copyright (C) 2011 RiSK (sscrisk)
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying

View file

@ -1,6 +1,8 @@
/*=============================================================================
Copyright (c) 2011 RiSK (sscrisk)
https://github.com/sscrisk/CEL---ConstExpr-Library
Copyright (c) 2011-2015 Bolero MURAKAMI
Copyright (C) 2011 RiSK (sscrisk)
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying

View file

@ -1,6 +1,8 @@
/*=============================================================================
Copyright (c) 2011 RiSK (sscrisk)
https://github.com/sscrisk/CEL---ConstExpr-Library
Copyright (c) 2011-2015 Bolero MURAKAMI
Copyright (C) 2011 RiSK (sscrisk)
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying

View file

@ -1,6 +1,8 @@
/*=============================================================================
Copyright (c) 2011 RiSK (sscrisk)
https://github.com/sscrisk/CEL---ConstExpr-Library
Copyright (c) 2011-2015 Bolero MURAKAMI
Copyright (C) 2011 RiSK (sscrisk)
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying

View file

@ -1,6 +1,8 @@
/*=============================================================================
Copyright (c) 2011 RiSK (sscrisk)
https://github.com/sscrisk/CEL---ConstExpr-Library
Copyright (c) 2011-2015 Bolero MURAKAMI
Copyright (C) 2011 RiSK (sscrisk)
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying

View file

@ -1,6 +1,8 @@
/*=============================================================================
Copyright (c) 2011 RiSK (sscrisk)
https://github.com/sscrisk/CEL---ConstExpr-Library
Copyright (c) 2011-2015 Bolero MURAKAMI
Copyright (C) 2011 RiSK (sscrisk)
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying

View file

@ -1,6 +1,8 @@
/*=============================================================================
Copyright (c) 2011 RiSK (sscrisk)
https://github.com/sscrisk/CEL---ConstExpr-Library
Copyright (c) 2011-2015 Bolero MURAKAMI
Copyright (C) 2011 RiSK (sscrisk)
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying

View file

@ -1,6 +1,8 @@
/*=============================================================================
Copyright (c) 2011 RiSK (sscrisk)
https://github.com/sscrisk/CEL---ConstExpr-Library
Copyright (c) 2011-2015 Bolero MURAKAMI
Copyright (C) 2011 RiSK (sscrisk)
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying

View file

@ -1,6 +1,8 @@
/*=============================================================================
Copyright (c) 2011 RiSK (sscrisk)
https://github.com/sscrisk/CEL---ConstExpr-Library
Copyright (c) 2011-2015 Bolero MURAKAMI
Copyright (C) 2011 RiSK (sscrisk)
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying

View file

@ -1,6 +1,8 @@
/*=============================================================================
Copyright (c) 2011 RiSK (sscrisk)
https://github.com/sscrisk/CEL---ConstExpr-Library
Copyright (c) 2011-2015 Bolero MURAKAMI
Copyright (C) 2011 RiSK (sscrisk)
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying

View file

@ -1,6 +1,8 @@
/*=============================================================================
Copyright (c) 2011 RiSK (sscrisk)
https://github.com/sscrisk/CEL---ConstExpr-Library
Copyright (c) 2011-2015 Bolero MURAKAMI
Copyright (C) 2011 RiSK (sscrisk)
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying

View file

@ -1,6 +1,8 @@
/*=============================================================================
Copyright (c) 2011 RiSK (sscrisk)
https://github.com/sscrisk/CEL---ConstExpr-Library
Copyright (c) 2011-2015 Bolero MURAKAMI
Copyright (C) 2011 RiSK (sscrisk)
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying

View file

@ -1,6 +1,8 @@
/*=============================================================================
Copyright (c) 2011 RiSK (sscrisk)
https://github.com/sscrisk/CEL---ConstExpr-Library
Copyright (c) 2011-2015 Bolero MURAKAMI
Copyright (C) 2011 RiSK (sscrisk)
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying

View file

@ -1,6 +1,8 @@
/*=============================================================================
Copyright (c) 2011 RiSK (sscrisk)
https://github.com/sscrisk/CEL---ConstExpr-Library
Copyright (c) 2011-2015 Bolero MURAKAMI
Copyright (C) 2011 RiSK (sscrisk)
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying

View file

@ -1,6 +1,8 @@
/*=============================================================================
Copyright (c) 2011 RiSK (sscrisk)
https://github.com/sscrisk/CEL---ConstExpr-Library
Copyright (c) 2011-2015 Bolero MURAKAMI
Copyright (C) 2011 RiSK (sscrisk)
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying

View file

@ -1,6 +1,8 @@
/*=============================================================================
Copyright (c) 2011 RiSK (sscrisk)
https://github.com/sscrisk/CEL---ConstExpr-Library
Copyright (c) 2011-2015 Bolero MURAKAMI
Copyright (C) 2011 RiSK (sscrisk)
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying

View file

@ -1,6 +1,8 @@
/*=============================================================================
Copyright (c) 2011 RiSK (sscrisk)
https://github.com/sscrisk/CEL---ConstExpr-Library
Copyright (c) 2011-2015 Bolero MURAKAMI
Copyright (C) 2011 RiSK (sscrisk)
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying

View file

@ -1,6 +1,8 @@
/*=============================================================================
Copyright (c) 2011 RiSK (sscrisk)
https://github.com/sscrisk/CEL---ConstExpr-Library
Copyright (c) 2011-2015 Bolero MURAKAMI
Copyright (C) 2011 RiSK (sscrisk)
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying

View file

@ -14,8 +14,8 @@
#include <sprout/index_tuple/metafunction.hpp>
#include <sprout/string/string.hpp>
#include <sprout/integer/integer_digits.hpp>
#include <sprout/type_traits/integral_constant.hpp>
#include <sprout/type_traits/enabler_if.hpp>
#include <sprout/type_traits/std_type_traits.hpp>
#include <sprout/detail/char_literal.hpp>
#include <sprout/detail/char_conversion.hpp>
#include <sprout/detail/math/int.hpp>
@ -28,7 +28,7 @@ namespace sprout {
struct printed_integer_digits
: public sprout::integral_constant<
std::size_t,
sprout::integer_digits<IntType, Base>::value + (std::is_signed<IntType>::value ? 1 : 0)
sprout::integer_digits<IntType, Base>::value + (sprout::is_signed<IntType>::value ? 1 : 0)
>
{};
@ -36,7 +36,7 @@ namespace sprout {
template<
typename Elem, int Base, typename IntType,
sprout::index_t... Indexes,
typename sprout::enabler_if<std::is_signed<IntType>::value>::type = sprout::enabler
typename sprout::enabler_if<sprout::is_signed<IntType>::value>::type = sprout::enabler
>
inline SPROUT_CONSTEXPR sprout::basic_string<Elem, sprout::printed_integer_digits<IntType, Base>::value>
int_to_string(IntType val, int digits, sprout::index_tuple<Indexes...>) {
@ -59,7 +59,7 @@ namespace sprout {
template<
typename Elem, int Base, typename IntType,
sprout::index_t... Indexes,
typename sprout::enabler_if<std::is_unsigned<IntType>::value>::type = sprout::enabler
typename sprout::enabler_if<sprout::is_unsigned<IntType>::value>::type = sprout::enabler
>
inline SPROUT_CONSTEXPR sprout::basic_string<Elem, sprout::printed_integer_digits<IntType, Base>::value>
int_to_string(IntType val, int digits, sprout::index_tuple<Indexes...>) {

View file

@ -0,0 +1,36 @@
/*=============================================================================
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)
=============================================================================*/
#ifndef SPROUT_TYPE_TRAITS_IS_SIGNED_HPP
#define SPROUT_TYPE_TRAITS_IS_SIGNED_HPP
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/type_traits/integral_constant.hpp>
#include <sprout/type_traits/detail/type_traits_wrapper.hpp>
namespace sprout {
//
// is_signed
//
namespace detail {
template<typename T, bool = std::is_arithmetic<T>::value>
struct is_signed_impl
: public sprout::false_type
{};
template<typename T>
struct is_signed_impl<T, true>
: public sprout::detail::type_traits_wrapper<std::is_signed<T> >
{};
} // namespace detail
template <typename T>
struct is_signed
: public sprout::detail::is_signed_impl<T>
{};
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_IS_SIGNED_HPP

View file

@ -10,7 +10,7 @@
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/type_traits/integral_constant.hpp>
#include <sprout/type_traits/std_type_traits.hpp>
namespace sprout {
//
@ -19,7 +19,7 @@ namespace sprout {
template<typename T>
struct is_sint
: public sprout::bool_constant<
std::is_integral<T>::value && std::is_signed<T>::value
std::is_integral<T>::value && sprout::is_signed<T>::value
>
{};

View file

@ -10,7 +10,7 @@
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/type_traits/integral_constant.hpp>
#include <sprout/type_traits/std_type_traits.hpp>
namespace sprout {
//
@ -19,7 +19,7 @@ namespace sprout {
template<typename T>
struct is_uint
: public sprout::bool_constant<
std::is_integral<T>::value && std::is_unsigned<T>::value
std::is_integral<T>::value && sprout::is_unsigned<T>::value
>
{};

View file

@ -0,0 +1,36 @@
/*=============================================================================
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)
=============================================================================*/
#ifndef SPROUT_TYPE_TRAITS_IS_UNSIGNED_HPP
#define SPROUT_TYPE_TRAITS_IS_UNSIGNED_HPP
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/type_traits/integral_constant.hpp>
#include <sprout/type_traits/detail/type_traits_wrapper.hpp>
namespace sprout {
//
// is_unsigned
//
namespace detail {
template<typename T, bool = std::is_arithmetic<T>::value>
struct is_unsigned_impl
: public sprout::false_type
{};
template<typename T>
struct is_unsigned_impl<T, true>
: public sprout::detail::type_traits_wrapper<std::is_unsigned<T> >
{};
} // namespace detail
template <typename T>
struct is_unsigned
: public sprout::detail::is_unsigned_impl<T>
{};
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_IS_UNSIGNED_HPP

View file

@ -15,6 +15,8 @@
#include <sprout/type_traits/integral_constant.hpp>
#include <sprout/type_traits/common_type.hpp>
#include <sprout/type_traits/is_null_pointer.hpp>
#include <sprout/type_traits/is_signed.hpp>
#include <sprout/type_traits/is_unsigned.hpp>
#include <sprout/type_traits/detail/type_traits_wrapper.hpp>
#if !defined(_LIBCPP_VERSION) || (_LIBCPP_VERSION < 1101)
# include <sprout/tpp/algorithm/max_element.hpp>
@ -157,14 +159,14 @@ namespace sprout {
struct is_abstract
: public sprout::detail::type_traits_wrapper<std::is_abstract<T> >
{};
template<typename T>
struct is_signed
: public sprout::detail::type_traits_wrapper<std::is_signed<T> >
{};
template<typename T>
struct is_unsigned
: public sprout::detail::type_traits_wrapper<std::is_unsigned<T> >
{};
// template<typename T>
// struct is_signed
// : public sprout::detail::type_traits_wrapper<std::is_signed<T> >
// {};
// template<typename T>
// struct is_unsigned
// : public sprout::detail::type_traits_wrapper<std::is_unsigned<T> >
// {};
template<typename T, typename... Args>
struct is_constructible
: public sprout::detail::type_traits_wrapper<std::is_constructible<T, Args...> >