ecl::enable_if< Condition, T > Struct Template Reference

Enables the SFINAE concept. More...

#include <enable_if.hpp>

Inheritance diagram for ecl::enable_if< Condition, T >:
Inheritance graph
[legend]

List of all members.


Detailed Description

template<class Condition, class T = void>
struct ecl::enable_if< Condition, T >

Enables the SFINAE concept.

This is the same as the boost and future C++0x implementations. Use this to do things like helping to instantiate families of specialisations. For example:

#include <ecl/type_traits/fundamental_types.hpp> // for is_float

// This will instantiate if it is anything except float or double.
template <typename T, typename Enable = void>
class TestObject {
public:
    bool isFloatSpecialisation() { return false; }
};

// This specialisation will instantiate it T is float or double.
template <typename T>
class TestObject< T, typename enable_if< is_float<T> >::type > {
public:
    bool isFloatSpecialisation() { return true; }
};

Definition at line 67 of file enable_if.hpp.


The documentation for this struct was generated from the following file:


ecl_mpl
Author(s): Daniel Stonier
autogenerated on Sun Oct 5 2014 23:35:20