[nstool] Add more constructors to sOptional

This commit is contained in:
jakcron 2018-08-24 16:08:16 +08:00
parent a1c5f91dc0
commit badebc6b65

View file

@ -48,6 +48,8 @@ struct sOptional
bool isSet; bool isSet;
T var; T var;
inline sOptional() : isSet(false) {} inline sOptional() : isSet(false) {}
inline sOptional(const T& other) : isSet(true), var(other) {}
inline sOptional(const sOptional& other) : isSet(other.isSet), var(other.var) {}
inline const T& operator=(const T& other) { isSet = true; var = other; return var; } inline const T& operator=(const T& other) { isSet = true; var = other; return var; }
inline const sOptional<T>& operator=(const sOptional<T>& other) inline const sOptional<T>& operator=(const sOptional<T>& other)
{ {