LibreOffice Module onlineupdate (master) 1
mozilla::EnableIf< B, T > Struct Template Reference

EnableIf is a struct containing a typedef of T if and only if B is true. More...

#include <TypeTraits.h>

Detailed Description

template<bool B, typename T>
struct mozilla::EnableIf< B, T >

EnableIf is a struct containing a typedef of T if and only if B is true.

mozilla::EnableIf<true, int>::Type is int; mozilla::EnableIf<false, int>::Type is a compile-time error.

Use this template to implement SFINAE-style (Substitution Failure Is not An Error) requirements. For example, you might use it to impose a restriction on a template parameter:

template<typename T> class PodVector // vector optimized to store POD (memcpy-able) types { EnableIf<IsPod<T>::value, T>::Type* vector; size_t length; ... };

Definition at line 1087 of file TypeTraits.h.


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