mirror of
https://github.com/bolero-MURAKAMI/Sprout.git
synced 2025-07-14 15:04:09 +00:00
fix for VC++11
This commit is contained in:
parent
d5c61e65ca
commit
f673db1451
18 changed files with 382 additions and 164 deletions
|
@ -3,7 +3,6 @@
|
|||
|
||||
#include <type_traits>
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/type_traits/enabler_if.hpp>
|
||||
|
||||
namespace sprout {
|
||||
// Copyright (C) 2011 RiSK (sscrisk)
|
||||
|
@ -35,23 +34,20 @@ namespace sprout {
|
|||
}
|
||||
|
||||
namespace {
|
||||
template<
|
||||
typename IntType,
|
||||
typename sprout::enabler_if<
|
||||
std::is_integral<IntType>::value && std::is_signed<IntType>::value
|
||||
>::type = sprout::enabler
|
||||
>
|
||||
inline SPROUT_CONSTEXPR IntType
|
||||
template<typename IntType>
|
||||
inline SPROUT_CONSTEXPR typename std::enable_if<
|
||||
std::is_integral<IntType>::value && std::is_signed<IntType>::value,
|
||||
IntType
|
||||
>::type
|
||||
abs(IntType j) {
|
||||
return j < 0 ? -j : j;
|
||||
}
|
||||
template<
|
||||
typename IntType,
|
||||
typename sprout::enabler_if<
|
||||
std::is_integral<IntType>::value && std::is_unsigned<IntType>::value
|
||||
>::type = sprout::enabler
|
||||
>
|
||||
inline SPROUT_CONSTEXPR IntType
|
||||
|
||||
template<typename IntType>
|
||||
inline SPROUT_CONSTEXPR typename std::enable_if<
|
||||
std::is_integral<IntType>::value && std::is_unsigned<IntType>::value,
|
||||
IntType
|
||||
>::type
|
||||
abs(IntType j) {
|
||||
return j;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue