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 --- libxsd/xsd/cxx/parser/validating/xml-schema-pimpl.hxx | 10 ++++++---- libxsd/xsd/cxx/parser/validating/xml-schema-pimpl.txx | 16 ++++++++++++++-- libxsd/xsd/cxx/parser/validating/xml-schema-pskel.hxx | 8 +++++--- 3 files changed, 25 insertions(+), 9 deletions(-) (limited to 'libxsd/xsd/cxx/parser/validating') diff --git a/libxsd/xsd/cxx/parser/validating/xml-schema-pimpl.hxx b/libxsd/xsd/cxx/parser/validating/xml-schema-pimpl.hxx index 0df1c4f..09194e4 100644 --- a/libxsd/xsd/cxx/parser/validating/xml-schema-pimpl.hxx +++ b/libxsd/xsd/cxx/parser/validating/xml-schema-pimpl.hxx @@ -8,6 +8,8 @@ #include +#include // XSD_AUTO_PTR + #include namespace xsd @@ -664,12 +666,12 @@ namespace xsd virtual void _post (); - virtual std::auto_ptr + virtual XSD_AUTO_PTR post_base64_binary (); protected: std::basic_string str_; - std::auto_ptr buf_; + XSD_AUTO_PTR buf_; }; // hexBinary @@ -686,12 +688,12 @@ namespace xsd virtual void _post (); - virtual std::auto_ptr + virtual XSD_AUTO_PTR post_hex_binary (); protected: std::basic_string str_; - std::auto_ptr buf_; + XSD_AUTO_PTR buf_; }; // gday diff --git a/libxsd/xsd/cxx/parser/validating/xml-schema-pimpl.txx b/libxsd/xsd/cxx/parser/validating/xml-schema-pimpl.txx index 021cca8..6631dd2 100644 --- a/libxsd/xsd/cxx/parser/validating/xml-schema-pimpl.txx +++ b/libxsd/xsd/cxx/parser/validating/xml-schema-pimpl.txx @@ -6,6 +6,10 @@ #include #include +#ifdef XSD_CXX11 +# include // std::move +#endif + #include #include @@ -1634,10 +1638,14 @@ namespace xsd } template - std::auto_ptr base64_binary_pimpl:: + XSD_AUTO_PTR base64_binary_pimpl:: post_base64_binary () { +#ifdef XSD_CXX11 + return std::move (buf_); +#else return buf_; +#endif } // hex_binary @@ -1721,10 +1729,14 @@ namespace xsd } template - std::auto_ptr hex_binary_pimpl:: + XSD_AUTO_PTR hex_binary_pimpl:: post_hex_binary () { +#ifdef XSD_CXX11 + return std::move (buf_); +#else return buf_; +#endif } // time_zone diff --git a/libxsd/xsd/cxx/parser/validating/xml-schema-pskel.hxx b/libxsd/xsd/cxx/parser/validating/xml-schema-pskel.hxx index 4641fe9..88cc3ab 100644 --- a/libxsd/xsd/cxx/parser/validating/xml-schema-pskel.hxx +++ b/libxsd/xsd/cxx/parser/validating/xml-schema-pskel.hxx @@ -7,7 +7,9 @@ #define XSD_CXX_PARSER_VALIDATING_XML_SCHEMA_PSKEL_HXX #include -#include // auto_ptr +#include // std::auto_ptr/unique_ptr + +#include // XSD_AUTO_PTR #include #include @@ -494,7 +496,7 @@ namespace xsd template struct base64_binary_pskel: simple_content { - virtual std::auto_ptr + virtual XSD_AUTO_PTR post_base64_binary () = 0; static const C* @@ -507,7 +509,7 @@ namespace xsd template struct hex_binary_pskel: simple_content { - virtual std::auto_ptr + virtual XSD_AUTO_PTR post_hex_binary () = 0; static const C* -- cgit v1.1