mirror of
https://github.com/CLIUtils/CLI11.git
synced 2025-04-30 12:43:52 +00:00
Dropping optimization for thread local (breaks XCode 7 support)
This commit is contained in:
parent
48ed89d004
commit
177f40a17c
@ -137,15 +137,7 @@ template <typename T,
|
|||||||
!std::is_assignable<T &, std::string>::value,
|
!std::is_assignable<T &, std::string>::value,
|
||||||
detail::enabler> = detail::dummy>
|
detail::enabler> = detail::dummy>
|
||||||
bool lexical_cast(std::string input, T &output) {
|
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;
|
std::istringstream is;
|
||||||
#else
|
|
||||||
static thread_local std::istringstream is;
|
|
||||||
is.clear();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
is.str(input);
|
is.str(input);
|
||||||
is >> output;
|
is >> output;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user