13template<
typename T,
class CompareEq = std::equal_to<T>>
19 CompareEq mComparator;
26 SetOnce(T initial,
const CompareEq& comp = CompareEq()) :
29 mDefaultValue(initial),
35 bool isSet()
const {
return mSet; }
36 const T&
value()
const {
return mValue; }
41 mValue = mDefaultValue;
46 if(!mSet && !mComparator(mDefaultValue,
value))
The SetOnce template class acts as a container for a value that can only be set once.
Definition qx-setonce.h:16
SetOnce< T, CompareEq > & operator=(const T &value)
Definition qx-setonce.h:44
SetOnce(T initial, const CompareEq &comp=CompareEq())
Definition qx-setonce.h:26
void reset()
Definition qx-setonce.h:38
const T & value() const
Definition qx-setonce.h:36
bool isSet() const
Definition qx-setonce.h:35
Specifies that a type defines a call operator for the specified argument types (with strict return).
Definition qx-concepts.h:253
The Qx namespace is the main namespace through which all non-global functionality of the Qx library i...
Definition qx-processwaiter.cpp:5
The qx-concepts header file provides a library of general purpose concepts as an extension of the sta...