#define WOLF_BASE_EXPORT Q_DECL_IMPORT
#endif
+#include <cstddef>
+
///special class for Null values
///this was a legacy class before nullptr was introduced, use nullptr now!
class WOLF_BASE_EXPORT NullValue
public:
NullValue(){}
NullValue(const NullValue&){}
- NullValue(const nullptr_t&){}
+ NullValue(const std::nullptr_t&){}
// operator void*()const{return (void*)0;}
template<typename T> operator T*()const{return (T*)nullptr;}
bool operator==(const NullValue&)const{return true;}
bool operator!=(const NullValue&)const{return false;}
- bool operator==(const nullptr_t&)const{return true;}
- bool operator!=(const nullptr_t&)const{return false;}
+ bool operator==(const std::nullptr_t&)const{return true;}
+ bool operator!=(const std::nullptr_t&)const{return false;}
template<typename T>bool operator==(const T*p)const{return p==nullptr;}
template<typename T>bool operator!=(const T*p)const{return p!=nullptr;}
Nullable(const NullValue&):isnull(true),elem(){}
/**creates a NULL value*/
//TODO: find an implementation that works without auto-casting 0 to nullptr while not using explicit
- explicit Nullable(const nullptr_t&):isnull(true),elem(){}
+ explicit Nullable(const std::nullptr_t&):isnull(true),elem(){}
/**creates a wrapped non-NULL value that is equivalent to the original*/
Nullable(const T&t):isnull(false),elem(t){}
/**copies a nullable value*/
///compares the Nullable with the special null value
bool operator!=(const NullValue&)const{return !isnull;}
///compares the Nullable with the special null value
- bool operator==(const nullptr_t&)const{return isnull;}
+ bool operator==(const std::nullptr_t&)const{return isnull;}
///compares the Nullable with the special null value
- bool operator!=(const nullptr_t&)const{return !isnull;}
+ bool operator!=(const std::nullptr_t&)const{return !isnull;}
private:
bool isnull;
T elem;