CppWAMP
C++11 client library for the WAMP protocol
null.hpp
Go to the documentation of this file.
1 /*------------------------------------------------------------------------------
2  Copyright Butterfly Energy Systems 2014-2015, 2022.
3  Distributed under the Boost Software License, Version 1.0.
4  http://www.boost.org/LICENSE_1_0.txt
5 ------------------------------------------------------------------------------*/
6 
7 #ifndef CPPWAMP_NULL_HPP
8 #define CPPWAMP_NULL_HPP
9 
10 //------------------------------------------------------------------------------
14 //------------------------------------------------------------------------------
15 
16 #include <ostream>
17 #include "api.hpp"
18 #include "config.hpp"
19 
20 namespace wamp
21 {
22 
23 //------------------------------------------------------------------------------
38 //------------------------------------------------------------------------------
39 struct CPPWAMP_API Null
40 {
42  constexpr Null() = default;
43 
45  bool operator==(Null) const {return true;}
46 
48  bool operator!=(Null) const {return false;}
49 
52  bool operator<(Null) const {return false;}
53 };
54 
55 //------------------------------------------------------------------------------
59 //------------------------------------------------------------------------------
60 CPPWAMP_API inline std::ostream& operator<<(std::ostream& out, Null)
61 {
62  return out << "null";
63 }
64 
65 //------------------------------------------------------------------------------
67 //------------------------------------------------------------------------------
68 CPPWAMP_INLINE_VARIABLE constexpr Null null;
69 
70 
71 } // namespace wamp
72 
73 #endif // CPPWAMP_NULL_HPP
wamp::Null
Type used to represent a null or empty Variant value.
Definition: null.hpp:39
api.hpp
Defines macros related to exporting/importing APIs.
wamp
Definition: anyhandler.hpp:36
wamp::Null::operator<
bool operator<(Null) const
Performs less-than comparison on two Null objects.
Definition: null.hpp:52
wamp::Null::operator!=
bool operator!=(Null) const
Compares two Null objects for inequality.
Definition: null.hpp:48
wamp::Null::operator==
bool operator==(Null) const
Compares two Null objects for equality.
Definition: null.hpp:45