mirror of
https://github.com/CLIUtils/CLI11.git
synced 2025-04-30 04:33:53 +00:00
Fix for non-cleared static stream in some cases
This commit is contained in:
parent
db202b831e
commit
ae3b5a69c7
@ -140,11 +140,12 @@ template <typename T,
|
||||
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
|
||||
// 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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user