18 template<
bool condition,
typename if_true,
typename if_false>
21 static const bool result;
30 template<
typename if_true,
typename if_false>
36 static const bool result =
true;
45 template<
typename if_true,
typename if_false>
49 typedef if_false type;
51 static const bool result =
false;
60 template<
bool condition,
typename T>
73 void operator= (
const T & t) { value_ = t; }
74 void operator= (T && t) { value_ = std::move(t); }
79 T & value () {
return value_; }
80 const T & value ()
const {
return value_; }
82 static inline bool isValue () {
return true; }
99 value_ = other.value_;
100 other.value_ =
nullptr;
105 void operator= (
const T & t) { *value_ = t; }
106 void operator= (T && t) { *value_ = std::move(t); }
113 value_ = other.value_;
117 T & value () {
return *value_; }
118 const T & value ()
const {
return *value_; }
120 static inline bool isValue () {
return false; }
129 void conditional_container<true, T>::operator= (
const conditional_container<false, T> & other) { value_ = other.conditional_container<false, T>::value(); }
Comment point for memory allocation in all modules.
A container, which either stores its value as a value or a pointer depending on the condition.
Definition type_selector.h:61
namespace Itasca
Definition basememory.cpp:14
if_true type
The actual "return value" of the type_selector.
Definition type_selector.h:34
Class used to select between two types based on a given condition.
Definition type_selector.h:20