16 template<
bool condition,
typename if_true,
typename if_false>
19 static const bool result;
28 template<
typename if_true,
typename if_false>
34 static const bool result =
true;
43 template<
typename if_true,
typename if_false>
47 typedef if_false type;
49 static const bool result =
false;
58 template<
bool condition,
typename T>
71 void operator= (
const T & t) { value_ = t; }
72 void operator= (T && t) { value_ = std::move(t); }
77 T & value () {
return value_; }
78 const T & value ()
const {
return value_; }
80 static inline bool isValue () {
return true; }
97 value_ = other.value_;
98 other.value_ =
nullptr;
103 void operator= (
const T & t) { *value_ = t; }
104 void operator= (T && t) { *value_ = std::move(t); }
111 value_ = other.value_;
115 T & value () {
return *value_; }
116 const T & value ()
const {
return *value_; }
118 static inline bool isValue () {
return false; }
127 void conditional_container<true, T>::operator= (
const conditional_container<false, T> & other) { value_ = other.conditional_container<false, T>::value(); }
A container, which either stores its value as a value or a pointer depending on the condition.
Definition type_selector.h:59
namespace Itasca
Definition basememory.cpp:10
if_true type
The actual "return value" of the type_selector.
Definition type_selector.h:32
Class used to select between two types based on a given condition.
Definition type_selector.h:18