From 39d814d4171e0e919e6a6a5cc11d0c1354e085ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aymeric=20PELL=C3=89?= Date: Thu, 9 Mar 2017 12:24:37 -0500 Subject: [PATCH] Fix istringtream type declaration. --- src/pugixml.cpp | 8 ++++---- src/pugixml.hpp | 9 +++++---- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/pugixml.cpp b/src/pugixml.cpp index 75d5842..511b5b7 100644 --- a/src/pugixml.cpp +++ b/src/pugixml.cpp @@ -5169,9 +5169,9 @@ namespace pugi #endif #ifndef PUGIXML_NO_STL - PUGI__FN std::istringstream xml_attribute::as_stringstream() const + PUGI__FN istringstream_t xml_attribute::as_stringstream() const { - return (_attr && _attr->value) ? std::istringstream(std::string(static_cast(_attr->value))) : std::istringstream(); + return (_attr && _attr->value) ? istringstream_t(string_t(static_cast(_attr->value))) : istringstream_t(); } #endif @@ -6426,11 +6426,11 @@ namespace pugi #endif #ifndef PUGIXML_NO_STL - PUGI__FN std::istringstream xml_text::as_stringstream() const + PUGI__FN istringstream_t xml_text::as_stringstream() const { xml_node_struct* d = _data(); - return (d && d->value) ? std::istringstream(std::string(static_cast(d->value))) : std::istringstream(); + return (d && d->value) ? istringstream_t(string_t(static_cast(d->value))) : istringstream_t(); } #endif diff --git a/src/pugixml.hpp b/src/pugixml.hpp index a4e3379..e3e24bc 100644 --- a/src/pugixml.hpp +++ b/src/pugixml.hpp @@ -108,6 +108,7 @@ namespace pugi #ifndef PUGIXML_NO_STL // String type used for operations that work with STL string; depends on PUGIXML_WCHAR_MODE typedef std::basic_string, std::allocator > string_t; + typedef std::basic_istringstream, std::allocator > istringstream_t; #endif } @@ -376,13 +377,13 @@ namespace pugi #ifndef PUGIXML_NO_STL // Get attribute value as std::istringstream, an empty std::istringstream if the attribute is empty - std::istringstream as_stringstream() const; + istringstream_t as_stringstream() const; // Get attribute value as Type (template parameter: try to read a Type value from the attribute value string) template Type as() const { - std::istringstream stream = as_stringstream(); + istringstream_t stream = as_stringstream(); Type value; stream >> value; return value; @@ -753,13 +754,13 @@ namespace pugi #ifndef PUGIXML_NO_STL // Get attribute value as std::istringstream, an empty std::istringstream if the attribute is empty - std::istringstream as_stringstream() const; + istringstream_t as_stringstream() const; // Get attribute value as Type (template parameter: try to read a Type value from the attribute value string) template Type as() const { - std::istringstream stream = as_stringstream(); + istringstream_t stream = as_stringstream(); Type value; stream >> value; return value;