1
0
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:
Joel Falcou
2015-07-24 20:13:32 +02:00
parent d9b28783e8
commit ad513c1641
3 changed files with 53 additions and 1 deletions

View File

@@ -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>
{ };