Commit 67c4eb71e5060ab1b28bd8a35bf8637585ef67ce
Committed by
Henry Schreiner
1 parent
8482b600
Style and typo fix
Showing
3 changed files
with
7 additions
and
8 deletions
include/CLI/Optional.hpp
| ... | ... | @@ -3,7 +3,7 @@ |
| 3 | 3 | // Distributed under the 3-Clause BSD License. See accompanying |
| 4 | 4 | // file LICENSE or https://github.com/CLIUtils/CLI11 for details. |
| 5 | 5 | |
| 6 | -#include <sstream> | |
| 6 | +#include <istream> | |
| 7 | 7 | |
| 8 | 8 | #include "CLI/Macros.hpp" |
| 9 | 9 | |
| ... | ... | @@ -15,11 +15,11 @@ |
| 15 | 15 | #define CLI11_STD_OPTIONAL |
| 16 | 16 | #endif |
| 17 | 17 | #endif |
| 18 | -#if defined(CPP11_CPP14) && __has_include(<experimental/optional>) | |
| 18 | +#if defined(CLI11_CPP14) && __has_include(<experimental/optional>) | |
| 19 | 19 | #include <experimental/optional> |
| 20 | 20 | #define CLI11_EXPERIMENTAL_OPTIONAL |
| 21 | 21 | #endif |
| 22 | -#if __has_include(<boost/optional>) | |
| 22 | +#if __has_include(<boost/optional.hpp>) | |
| 23 | 23 | #include <boost/optional.hpp> |
| 24 | 24 | #define CLI11_BOOST_OPTIONAL |
| 25 | 25 | #endif |
| ... | ... | @@ -44,16 +44,16 @@ template <typename T> std::istream &operator>>(std::istream &in, std::experiment |
| 44 | 44 | val = v; |
| 45 | 45 | return in; |
| 46 | 46 | } |
| 47 | +#endif | |
| 47 | 48 | |
| 48 | 49 | #ifdef CLI11_BOOST_OPTIONAL |
| 49 | -template <typename T> std::istream &operator>>(std::istream &in, boost::optional<T> &val) { | |
| 50 | +template <typename T> std::istringstream &operator>>(std::istringstream &in, boost::optional<T> &val) { | |
| 50 | 51 | T v; |
| 51 | 52 | in >> v; |
| 52 | 53 | val = v; |
| 53 | 54 | return in; |
| 54 | 55 | } |
| 55 | 56 | #endif |
| 56 | -#endif | |
| 57 | 57 | |
| 58 | 58 | // Export the best optional to the CLI namespace |
| 59 | 59 | #if defined(CLI11_STD_OPTIONAL) | ... | ... |
tests/OptionalTest.cpp
tests/informational.cpp