plll
1.0
|
A type selector template. More...
#include <helper.hpp>
Public Types | |
typedef implementation::select_first_type_impl < cond, A, B >::result | result |
The result type. Either A or B , depending on the value of cond . | |
A type selector template.
Defines SelectFirstType<cond, A, B>::result
as A
in case cond
is true
, and B
in case cond
is false. This is used in template metaprogramming to realize certain compile time if
clauses.
cond | An expression which evaluates to a bool at compile time. |
A | A type name; result will have this type in case cond evalutes to true . |
B | A type name; result will have this type in case cond evalutes to false . |
This was taken from "Modern C++ Design" by Andrei Alexandrescu. Note that in C++11, std::conditional<>
provides the same functionality.
Definition at line 120 of file helper.hpp.