diff --git a/include/fc/value.hpp b/include/fc/value.hpp index 84ca8f5..11d1354 100644 --- a/include/fc/value.hpp +++ b/include/fc/value.hpp @@ -86,6 +86,7 @@ namespace fc { value& operator=( value&& v ); value& operator=( const value& v ); + /** * Include fc/value_cast.hpp for implementation */ @@ -137,6 +138,8 @@ namespace fc { aligned<24> holder; }; + bool operator == ( const value& v, std::nullptr_t ); + bool operator != ( const value& v, std::nullptr_t ); struct value::key_val { key_val(){}; diff --git a/src/value.cpp b/src/value.cpp index fdce710..a3c0f2b 100644 --- a/src/value.cpp +++ b/src/value.cpp @@ -250,6 +250,12 @@ value::value( value::object& a ){ static_assert( sizeof(holder) >= sizeof( detail::value_holder_impl ), "size check" ); new (holder) detail::value_holder_impl(a); } +bool operator == ( const value& v, std::nullptr_t ) { + return v.is_null(); +} +bool operator != ( const value& v, std::nullptr_t ) { + return v.is_null(); +} value& value::operator=( value&& v ){ decltype(holder) tmp;