mirror of
https://github.com/nlohmann/json.git
synced 2026-11-03 11:25:33 +00:00
Merge develop into fix/bjdata-count-size-max
Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
4 files changed
+28
-20
No files matched your search
@@ -505,8 +505,8 @@ struct locale_switching_token
|
||||
{
|
||||
using value_type = char;
|
||||
|
||||
locale_switching_token(std::string text_, const char* switch_to_)
|
||||
: text(std::move(text_)), switch_to(switch_to_)
|
||||
locale_switching_token(std::string text_, std::string switch_to_)
|
||||
: text(std::move(text_)), switch_to(std::move(switch_to_))
|
||||
{}
|
||||
|
||||
std::size_t size() const
|
||||
@@ -523,13 +523,13 @@ struct locale_switching_token
|
||||
{
|
||||
if (!switched)
|
||||
{
|
||||
switched = std::setlocale(LC_NUMERIC, switch_to) != nullptr;
|
||||
switched = std::setlocale(LC_NUMERIC, switch_to.c_str()) != nullptr;
|
||||
}
|
||||
return &text[0];
|
||||
}
|
||||
|
||||
std::string text;
|
||||
const char* switch_to;
|
||||
std::string switch_to;
|
||||
bool switched = false;
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user