18 #ifndef LOG4CXX_OPTIONAL_HDR_
19 #define LOG4CXX_OPTIONAL_HDR_
22 # if __has_include(<optional>)
24 # if defined(__cpp_lib_optional)
25 namespace LOG4CXX_NS {
template<
class T >
using Optional = std::optional<T>; }
26 #define LOG4CXX_HAS_STD_OPTIONAL 1
28 # elif __has_include(<experimental/optional>)
29 # include <experimental/optional>
30 namespace LOG4CXX_NS {
template<
class T >
using Optional = std::experimental::optional<T>; }
31 #define LOG4CXX_HAS_STD_OPTIONAL 1
32 # elif __has_include(<boost/optional.hpp>)
33 # include <boost/optional.hpp>
34 namespace LOG4CXX_NS {
template<
class T >
using Optional = boost::optional<T>; }
35 #define LOG4CXX_HAS_STD_OPTIONAL 1
37 #define LOG4CXX_HAS_STD_OPTIONAL 0
41 #if !LOG4CXX_HAS_STD_OPTIONAL
47 using BaseType = std::pair<bool, T>;
56 constexpr
explicit operator bool() const noexcept {
return this->first; }
57 constexpr
bool has_value() const noexcept {
return this->first; }
58 constexpr
const T&
value() const noexcept {
return this->second; }
Definition: optional.h:46
constexpr const T & value() const noexcept
Definition: optional.h:58
constexpr bool has_value() const noexcept
Definition: optional.h:57
Optional()
Definition: optional.h:49
Optional & operator=(const T &value)
Definition: optional.h:50