forked from boostorg/core
Introduces enable_if_type
enable_if_type allow to perform SFINAE check on the existence of a dependent type. It has been used here and there in various boost library but it's useful enough to warrant an autonomous existence.
This commit is contained in:
@@ -23,6 +23,11 @@
|
||||
|
||||
namespace boost
|
||||
{
|
||||
template<typename T, typename R=void>
|
||||
struct enable_if_type
|
||||
{
|
||||
typedef R type;
|
||||
};
|
||||
|
||||
template <bool B, class T = void>
|
||||
struct enable_if_c {
|
||||
@@ -80,6 +85,10 @@ namespace boost {
|
||||
template <typename T>
|
||||
struct enable_if_does_not_work_on_this_compiler;
|
||||
|
||||
template<typename T, typename R=void>
|
||||
struct enable_if_type : enable_if_does_not_work_on_this_compiler<T>
|
||||
{ };
|
||||
|
||||
template <bool B, class T = detail::enable_if_default_T>
|
||||
struct enable_if_c : enable_if_does_not_work_on_this_compiler<T>
|
||||
{ };
|
||||
|
||||
Reference in New Issue
Block a user