8 #include "CLI/Macros.hpp" 15 #ifndef CLI11_STD_OPTIONAL 17 #if defined(CLI11_CPP17) && __has_include(<optional>) 18 #define CLI11_STD_OPTIONAL 1 20 #define CLI11_STD_OPTIONAL 0 23 #define CLI11_STD_OPTIONAL 0 27 #ifndef CLI11_EXPERIMENTAL_OPTIONAL 28 #define CLI11_EXPERIMENTAL_OPTIONAL 0 31 #ifndef CLI11_BOOST_OPTIONAL 32 #define CLI11_BOOST_OPTIONAL 0 35 #if CLI11_BOOST_OPTIONAL 36 #include <boost/version.hpp> 37 #if BOOST_VERSION < 106100 38 #error "This boost::optional version is not supported, use 1.61 or better" 42 #if CLI11_STD_OPTIONAL 45 #if CLI11_EXPERIMENTAL_OPTIONAL 46 #include <experimental/optional> 48 #if CLI11_BOOST_OPTIONAL 49 #include <boost/optional.hpp> 50 #include <boost/optional/optional_io.hpp> 56 #if CLI11_STD_OPTIONAL 57 template <
typename T> std::istream &
operator>>(std::istream &in, std::optional<T> &val) {
65 #if CLI11_EXPERIMENTAL_OPTIONAL 66 template <
typename T> std::istream &
operator>>(std::istream &in, std::experimental::optional<T> &val) {
74 #if CLI11_BOOST_OPTIONAL 75 template <
typename T> std::istream &
operator>>(std::istream &in, boost::optional<T> &val) {
84 #if CLI11_STD_OPTIONAL 86 #elif CLI11_EXPERIMENTAL_OPTIONAL 87 using std::experimental::optional;
88 #elif CLI11_BOOST_OPTIONAL 89 using boost::optional;
93 #if CLI11_STD_OPTIONAL || CLI11_EXPERIMENTAL_OPTIONAL || CLI11_BOOST_OPTIONAL 94 #define CLI11_OPTIONAL 1
std::istream & operator>>(std::istream &in, T &item)
input streaming for enumerations
Definition: StringTools.hpp:30