diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2014-01-19 10:05:08 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2014-01-19 10:06:32 +0200 |
commit | 0fdf19714613a82a184f4f6e75fb9a4f9b62f18a (patch) | |
tree | 93bb2df0f9d9eab44d36dedf29d4df500ecefcbc /libxsd/xsd/cxx/parser/validating | |
parent | 45db924dfc19b49b7930522dbddd123fb9575e32 (diff) |
Use std::unique_ptr instead of std::auto_ptr in C++11 mode
Diffstat (limited to 'libxsd/xsd/cxx/parser/validating')
-rw-r--r-- | libxsd/xsd/cxx/parser/validating/xml-schema-pimpl.hxx | 10 | ||||
-rw-r--r-- | libxsd/xsd/cxx/parser/validating/xml-schema-pimpl.txx | 16 | ||||
-rw-r--r-- | libxsd/xsd/cxx/parser/validating/xml-schema-pskel.hxx | 8 |
3 files changed, 25 insertions, 9 deletions
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 <string> +#include <xsd/cxx/config.hxx> // XSD_AUTO_PTR + #include <xsd/cxx/parser/validating/xml-schema-pskel.hxx> namespace xsd @@ -664,12 +666,12 @@ namespace xsd virtual void _post (); - virtual std::auto_ptr<buffer> + virtual XSD_AUTO_PTR<buffer> post_base64_binary (); protected: std::basic_string<C> str_; - std::auto_ptr<buffer> buf_; + XSD_AUTO_PTR<buffer> buf_; }; // hexBinary @@ -686,12 +688,12 @@ namespace xsd virtual void _post (); - virtual std::auto_ptr<buffer> + virtual XSD_AUTO_PTR<buffer> post_hex_binary (); protected: std::basic_string<C> str_; - std::auto_ptr<buffer> buf_; + XSD_AUTO_PTR<buffer> 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 <limits> #include <locale> +#ifdef XSD_CXX11 +# include <utility> // std::move +#endif + #include <xsd/cxx/zc-istream.hxx> #include <xsd/cxx/parser/validating/exceptions.hxx> @@ -1634,10 +1638,14 @@ namespace xsd } template <typename C> - std::auto_ptr<buffer> base64_binary_pimpl<C>:: + XSD_AUTO_PTR<buffer> base64_binary_pimpl<C>:: post_base64_binary () { +#ifdef XSD_CXX11 + return std::move (buf_); +#else return buf_; +#endif } // hex_binary @@ -1721,10 +1729,14 @@ namespace xsd } template <typename C> - std::auto_ptr<buffer> hex_binary_pimpl<C>:: + XSD_AUTO_PTR<buffer> hex_binary_pimpl<C>:: 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 <string> -#include <memory> // auto_ptr +#include <memory> // std::auto_ptr/unique_ptr + +#include <xsd/cxx/config.hxx> // XSD_AUTO_PTR #include <xsd/cxx/parser/xml-schema.hxx> #include <xsd/cxx/parser/validating/parser.hxx> @@ -494,7 +496,7 @@ namespace xsd template <typename C> struct base64_binary_pskel: simple_content<C> { - virtual std::auto_ptr<buffer> + virtual XSD_AUTO_PTR<buffer> post_base64_binary () = 0; static const C* @@ -507,7 +509,7 @@ namespace xsd template <typename C> struct hex_binary_pskel: simple_content<C> { - virtual std::auto_ptr<buffer> + virtual XSD_AUTO_PTR<buffer> post_hex_binary () = 0; static const C* |