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 committed 2015-08-10 16:55:44 +02:00
1 parent d9b28783e8
commit ad513c1641
3 files changed
+53 -1

No files matched your search

+9
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>
{ };