Elm  2
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
enable_if< B, T > Struct Template Reference

#include <elm/meta.h>

Detailed Description

template<bool B, class T = void>
struct elm::meta::enable_if< B, T >

This meta-structure is useful to define a type that depends on a condition, usually #SFINAE function. If the condition B is true, the returned type contains a type named "_" equal to T. Else the returned structure is void.

A typical utilization is a template definition that is configured according to a specific support as in the example below. If the type contains a function "f" (without argument) it is called. Else it is not.

template <class T>
meta::enable_if<meta::is_supported<T, has_f> >::_ void call(T& x) { x.f(); }
template <class T>
meta::enable_if<!meta::is_supported<T, has_f> >::_ void call(T& x) { }
Parameters
BCondition.
TType (default to void).

The documentation for this struct was generated from the following file:
elm::_
AutoStringStartup & _
Definition: debug_CrashHandler.cpp:232