MCPcopy Create free account
hub / github.com/HaxeFoundation/hxcpp / Null

Class Null

include/null.h:184–209  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

182
183template<typename T>
184struct Null
185{
186 inline Null() : isNull(true) { }
187 inline Null(const Null<T> &inOther) : isNull(inOther.isNull), value(inOther.value) { }
188 inline Null(const T& inVal) : isNull(false), value(inVal) { }
189 inline Null(const null &) : isNull(true) { }
190 inline Null(const Dynamic &inVal)
191 {
192 isNull = null() == inVal;
193 if (!isNull)
194 value = inVal;
195 }
196 inline Null(const cpp::Variant &inVal)
197 {
198 isNull = inVal.isNull();
199 if (!isNull)
200 value = inVal;
201 }
202
203 inline operator Dynamic();
204 inline operator T() { return isNull ? null() : value; }
205 inline T Default(T inDefault) { return isNull ? inDefault : value; }
206
207 bool isNull;
208 T value;
209};
210
211} // end namesapce hx
212

Callers

nothing calls this directly

Calls 1

nullClass · 0.70

Tested by

no test coverage detected