From 0fdf19714613a82a184f4f6e75fb9a4f9b62f18a Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sun, 19 Jan 2014 10:05:08 +0200 Subject: Use std::unique_ptr instead of std::auto_ptr in C++11 mode --- xsd/cxx/tree/fundamental-header.hxx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'xsd/cxx/tree/fundamental-header.hxx') diff --git a/xsd/cxx/tree/fundamental-header.hxx b/xsd/cxx/tree/fundamental-header.hxx index 2171de4..18a5e61 100644 --- a/xsd/cxx/tree/fundamental-header.hxx +++ b/xsd/cxx/tree/fundamental-header.hxx @@ -1146,7 +1146,8 @@ namespace CXX << "{"; // @@ Disregarding current naming convention by using the - // fixed name (no template typedef). + // fixed name (even in C++11, template alias is not yet + // widely supported). // if (doxygen) os << "/**" << endl @@ -1156,8 +1157,12 @@ namespace CXX os << "// Automatic pointer for DOMDocument." << endl << "//" << endl; - os << "using ::xsd::cxx::xml::dom::auto_ptr;" - << endl; + if (std >= cxx_version::cxx11) + os << "using ::xsd::cxx::xml::dom::unique_ptr;"; + else + os << "using ::xsd::cxx::xml::dom::auto_ptr;"; + + os << endl; if (parsing) { -- cgit v1.1