CppWAMP
C++11 client library for the WAMP protocol
wamp::Null Struct Reference

Type used to represent a null or empty Variant value. More...

#include <cppwamp/null.hpp>

Public Member Functions

constexpr Null ()=default
 Default constructor for instantiating constexpr object.
 
bool operator== (Null) const
 Compares two Null objects for equality. More...
 
bool operator!= (Null) const
 Compares two Null objects for inequality. More...
 
bool operator< (Null) const
 Performs less-than comparison on two Null objects. More...
 

Related Functions

(Note that these are not member functions.)

std::ostream & operator<< (std::ostream &out, Null)
 

Detailed Description

Type used to represent a null or empty Variant value.

The wamp::null constant should be used to nullify a Variant, and for checking if a Variant is empty:

using namespace wamp;
Variant v(42); // v contains an integer
v = null; // v is now empty
// Check if v is null
if (v == null)
std::cout << "v is empty\n";
See also
wamp::null

Member Function Documentation

◆ operator==()

bool wamp::Null::operator== ( Null  ) const
inline

Compares two Null objects for equality.

Returns
always true.

◆ operator!=()

bool wamp::Null::operator!= ( Null  ) const
inline

Compares two Null objects for inequality.

Returns
always false.

◆ operator<()

bool wamp::Null::operator< ( Null  ) const
inline

Performs less-than comparison on two Null objects.

Returns
always false.

Friends And Related Function Documentation

◆ operator<<()

std::ostream & operator<< ( std::ostream &  out,
Null   
)
related

Outputs a Null object to the given output stream. The string "null" (without the quotes) will be outputted.


The documentation for this struct was generated from the following file:
wamp::Variant
Discriminated union container that represents a JSON value.
Definition: variant.hpp:134
wamp
Definition: anyhandler.hpp:36