|
#ifndef _TYPEMANIP_HPP_
#define _TYPEMANIP_HPP_
// ****************************************************************************
// CREATED_ON : 09-07-03
// CREATED_BY : Martin Lutken
// ****************************************************************************
#include "tutils.h"
_TUTILS_BEGIN_NAMESPACE
/** Class template select. (From loki library, but uses stl naming style here)
Selects one of two types based upon a boolean constant
Invocation: select<flag, T, U>::result
where:
flag is a compile-time boolean constant
T and U are types
Result evaluates to T if flag is true, and to U otherwise.*/
template <bool flag, typename T, typename U>
struct select
{
typedef T result;
};
template <typename T, typename U>
struct select<false, T, U>
{
typedef U result;
};
_TUTILS_END_NAMESPACE
#endif
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.
A list of licenses authors might use can be found here
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.