1
0
mirror of https://github.com/CLIUtils/CLI11.git synced 2025-04-30 04:33:53 +00:00

Dropping optimization for thread local (breaks XCode 7 support)

This commit is contained in:
Henry Fredrick Schreiner 2018-04-18 13:59:02 +02:00
parent 48ed89d004
commit 177f40a17c

View File

@ -137,15 +137,7 @@ template <typename T,
!std::is_assignable<T &, std::string>::value,
detail::enabler> = detail::dummy>
bool lexical_cast(std::string input, T &output) {
// On GCC 4.7, thread_local is not available, so this optimization
// is turned off (avoiding multiple initialisations on multiple usages)
#if defined(__GNUC__) && !defined(__clang__) && !defined(__INTEL_COMPILER) && __GNUC__ == 4 && (__GNUC_MINOR__ < 8)
std::istringstream is;
#else
static thread_local std::istringstream is;
is.clear();
#endif
is.str(input);
is >> output;