12 #ifndef __JSONV_OPTIONAL_HPP_INCLUDED__ 13 #define __JSONV_OPTIONAL_HPP_INCLUDED__ 17 #ifndef JSONV_OPTIONAL_USE_STD 18 # define JSONV_OPTIONAL_USE_STD 0 21 #ifndef JSONV_OPTIONAL_USE_STD_EXPERIMENTAL 22 # define JSONV_OPTIONAL_USE_STD_EXPERIMENTAL 0 25 #ifndef JSONV_OPTIONAL_USE_BOOST 26 # define JSONV_OPTIONAL_USE_BOOST 0 30 #if !defined(JSONV_OPTIONAL_TYPE) && !JSONV_OPTIONAL_USE_STD && !JSONV_OPTIONAL_USE_STD_EXPERIMENTAL && !JSONV_OPTIONAL_USE_BOOST 31 # if __cplusplus > 201700L 32 # undef JSONV_OPTIONAL_USE_STD 33 # define JSONV_OPTIONAL_USE_STD 1 35 # undef JSONV_OPTIONAL_USE_STD_EXPERIMENTAL 36 # define JSONV_OPTIONAL_USE_STD_EXPERIMENTAL 1 61 #ifndef JSONV_OPTIONAL_TYPE 62 # if defined(JSONV_OPTIONAL_USE_STD_EXPERIMENTAL) && JSONV_OPTIONAL_USE_STD_EXPERIMENTAL 63 # define JSONV_OPTIONAL_TYPE std::experimental::optional 64 # define JSONV_NULLOPT_VALUE std::experimental::nullopt 65 # define JSONV_OPTIONAL_INCLUDE <experimental/optional> 66 # elif defined(JSONV_OPTIONAL_USE_BOOST) && JSONV_OPTIONAL_USE_BOOST 67 # define JSONV_OPTIONAL_TYPE boost::optional 68 # define JSONV_NULLOPT_VALUE boost::none 69 # define JSONV_OPTIONAL_INCLUDE <boost/optional.hpp> 71 # define JSONV_OPTIONAL_TYPE std::optional 72 # define JSONV_NULLOPT_VALUE std::nullopt 73 # define JSONV_OPTIONAL_INCLUDE <optional> 77 #include JSONV_OPTIONAL_INCLUDE Copyright (c) 2014-2019 by Travis Gockel.
#define JSONV_NULLOPT_VALUE
The value to use for jsonv::nullopt By default, this is std::nullopt or std::experimental::nullopt (b...
#define JSONV_UNUSED
Note that you know the variable is unused, but make the compiler stop complaining about it...
JSONV_OPTIONAL_TYPE< T > optional
Represents a value that may or may not be present.