ACE  6.2.8
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ACE::If_Then_Else< C, Ta, Tb > Struct Template Reference

Compile-time selection of type based on a boolean value. More...

#include <If_Then_Else.h>

Detailed Description

template<bool C, typename Ta, typename Tb>
struct ACE::If_Then_Else< C, Ta, Tb >

Compile-time selection of type based on a boolean value.

Select of type Tb if boolean value is false.

Select of type Ta if boolean value is true.

This primary template selects the second or third argument based on the value of the boolean first argument.

Usage example:

template <typename T>
class Foo
{
public:
// Set "TheType" to be the larger of "T" and "int".
typedef typename If_Then_Else<(sizeof (T) > sizeof (int)),
T,
int>::result_type TheType;
};
Note
This merely a forward declaration since we really only care about the partial specializations below.

This partial specialization selects the type Ta if the boolean first argument is true.

This partial specialization selects the type Tb if the boolean first argument is false.


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