Skip to content
Snippets Groups Projects
Commit 5a7a4bc8 authored by Markus Blatt's avatar Markus Blatt
Browse files

Added compile time type selector.

[[Imported from SVN: r1499]]
parent 83b348b7
No related branches found
No related tags found
No related merge requests found
......@@ -199,6 +199,32 @@ namespace Dune
{
enum { value=true};
};
/**
* @brief Select a type based on a condition.
*
* If template parameter first is true T1 is selected
* otherwise T2 will be selected.
* The selected type id accessible through the typedef
* Type.
*/
template<bool first, class T1, class T2>
struct SelectType
{
/**
* @brief The selected type.
*
* if first is true this will be type T1 and
* otherwise T2
*/
typedef T1 Type;
};
template<class T1, class T2>
struct SelectType<false,T1,T2>
{
typedef T2 Type;
};
/** @} */
}
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment