Default disable/enable_if to a nat type instead of void, as many SFINAE expressions in funcions default to void *values that are valid parameters.

This commit is contained in:
Ion Gaztañaga 2019-01-03 00:07:21 +01:00
parent ca4fd7288d
commit 754eaae8e5
2 changed files with 19 additions and 6 deletions

View File

@ -802,6 +802,14 @@ Special thanks to:
[section:release_notes Release Notes]
[section:release_notes_boost_1_70 Boost 1.70 Release]
* Removed support for deprecated GCC compilers.
* Fixed bugs:
* [@https://github.com/boostorg/move/pull/23 Git Pull #23: ['"Add minimal cmake file "]].
[endsect]
[section:release_notes_boost_1_69 Boost 1.69 Release]
* Deprecated GCC < 4.3 and MSVC < 9.0 (Visual 2008) compilers.

View File

@ -27,6 +27,9 @@
namespace boost {
namespace move_detail {
template<typename T>
struct voider { typedef void type; };
//////////////////////////////////////
// if_c
//////////////////////////////////////
@ -52,7 +55,9 @@ struct if_ : if_c<0 != T1::value, T2, T3>
//////////////////////////////////////
// enable_if_c
//////////////////////////////////////
template <bool B, class T = void>
struct enable_if_nat{};
template <bool B, class T = enable_if_nat>
struct enable_if_c
{
typedef T type;
@ -64,13 +69,13 @@ struct enable_if_c<false, T> {};
//////////////////////////////////////
// enable_if
//////////////////////////////////////
template <class Cond, class T = void>
template <class Cond, class T = enable_if_nat>
struct enable_if : enable_if_c<Cond::value, T> {};
//////////////////////////////////////
// disable_if_c
//////////////////////////////////////
template <bool B, class T = void>
template <bool B, class T = enable_if_nat>
struct disable_if_c
: enable_if_c<!B, T>
{};
@ -78,7 +83,7 @@ struct disable_if_c
//////////////////////////////////////
// disable_if
//////////////////////////////////////
template <class Cond, class T = void>
template <class Cond, class T = enable_if_nat>
struct disable_if : enable_if_c<!Cond::value, T> {};
//////////////////////////////////////
@ -117,13 +122,13 @@ struct is_same<T, T>
//////////////////////////////////////
// enable_if_same
//////////////////////////////////////
template <class T, class U, class R = void>
template <class T, class U, class R = enable_if_nat>
struct enable_if_same : enable_if<is_same<T, U>, R> {};
//////////////////////////////////////
// disable_if_same
//////////////////////////////////////
template <class T, class U, class R = void>
template <class T, class U, class R = enable_if_nat>
struct disable_if_same : disable_if<is_same<T, U>, R> {};
} //namespace move_detail {