Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions include/yaml-cpp/emitter.h
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ inline Emitter& Emitter::WriteIntegralType(T value) {
PrepareNode(EmitterNodeType::Scalar);

std::stringstream stream;
stream.imbue(std::locale("C"));
stream.imbue(std::locale::classic());
PrepareIntegralStream(stream);
stream << value;
m_stream << stream.str();
Expand All @@ -166,7 +166,7 @@ inline Emitter& Emitter::WriteStreamable(T value) {
PrepareNode(EmitterNodeType::Scalar);

std::stringstream stream;
stream.imbue(std::locale("C"));
stream.imbue(std::locale::classic());
SetStreamablePrecision<T>(stream);

bool special = false;
Expand Down
4 changes: 2 additions & 2 deletions include/yaml-cpp/node/convert.h
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ ConvertStreamTo(std::stringstream& stream, T& rhs) {
\
static Node encode(const type& rhs) { \
std::stringstream stream; \
stream.imbue(std::locale("C")); \
stream.imbue(std::locale::classic()); \
stream.precision(std::numeric_limits<type>::max_digits10); \
conversion::inner_encode(rhs, stream); \
return Node(stream.str()); \
Expand All @@ -184,7 +184,7 @@ ConvertStreamTo(std::stringstream& stream, T& rhs) {
} \
const std::string& input = node.Scalar(); \
std::stringstream stream(input); \
stream.imbue(std::locale("C")); \
stream.imbue(std::locale::classic()); \
stream.unsetf(std::ios::dec); \
if ((stream.peek() == '-') && std::is_unsigned<type>::value) { \
return false; \
Expand Down
2 changes: 1 addition & 1 deletion include/yaml-cpp/traits.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ template<typename Key, bool Streamable>
struct streamable_to_string {
static std::string impl(const Key& key) {
std::stringstream ss;
ss.imbue(std::locale("C"));
ss.imbue(std::locale::classic());
ss << key;
return ss.str();
}
Expand Down
8 changes: 4 additions & 4 deletions src/fptostring.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ std::string FpToString(T v, int precision = 0) {
// dragonbox/to_decimal does not handle value 0, inf, NaN
if (v == 0 || std::isinf(v) || std::isnan(v)) {
std::stringstream ss;
ss.imbue(std::locale("C"));
ss.imbue(std::locale::classic());
ss << v;
return ss.str();
}
Expand All @@ -98,7 +98,7 @@ std::string FpToString(T v, int precision = 0) {
// defensive programming, ConvertToChars arguments are invalid
if (digits_ct == -1) {
std::stringstream ss;
ss.imbue(std::locale("C"));
ss.imbue(std::locale::classic());
ss << v;
return ss.str();
}
Expand Down Expand Up @@ -161,7 +161,7 @@ std::string FpToString(T v, int precision = 0) {
// defensive programming, ConvertToChars arguments are invalid
if (exp_digits_ct == -1) {
std::stringstream ss;
ss.imbue(std::locale("C"));
ss.imbue(std::locale::classic());
ss << v;
return ss.str();
}
Expand Down Expand Up @@ -226,7 +226,7 @@ std::string FpToString(double v, size_t precision) {
*/
std::string FpToString(long double v, size_t precision) {
std::stringstream ss;
ss.imbue(std::locale("C"));
ss.imbue(std::locale::classic());
if (precision == 0) {
precision = std::numeric_limits<long double>::max_digits10;
}
Expand Down
2 changes: 1 addition & 1 deletion src/node_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ void node_data::convert_sequence_to_map(const shared_memory_holder& pMemory) {
reset_map();
for (std::size_t i = 0; i < m_sequence.size(); i++) {
std::stringstream stream;
stream.imbue(std::locale("C"));
stream.imbue(std::locale::classic());
stream << i;

node& key = pMemory->create_node();
Expand Down
2 changes: 1 addition & 1 deletion src/parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ void Parser::HandleYamlDirective(const Token& token) {
}

std::stringstream str(token.params[0]);
str.imbue(std::locale("C"));
str.imbue(std::locale::classic());
str >> m_pDirectives->version.major;
str.get();
str >> m_pDirectives->version.minor;
Expand Down
Loading