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/tree/types.txx | |
parent | 45db924dfc19b49b7930522dbddd123fb9575e32 (diff) |
Use std::unique_ptr instead of std::auto_ptr in C++11 mode
Diffstat (limited to 'libxsd/xsd/cxx/tree/types.txx')
-rw-r--r-- | libxsd/xsd/cxx/tree/types.txx | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/libxsd/xsd/cxx/tree/types.txx b/libxsd/xsd/cxx/tree/types.txx index 98fcf81..61cb419 100644 --- a/libxsd/xsd/cxx/tree/types.txx +++ b/libxsd/xsd/cxx/tree/types.txx @@ -6,7 +6,13 @@ #include <xercesc/util/Base64.hpp> #include <xercesc/util/XMLString.hpp> -#include <xsd/cxx/auto-array.hxx> +#include <xsd/cxx/config.hxx> // XSD_CXX11 + +#ifdef XSD_CXX11 +# include <memory> // std::unique_ptr +#else +# include <xsd/cxx/auto-array.hxx> +#endif #include <xsd/cxx/xml/std-memory-manager.hxx> @@ -318,9 +324,13 @@ namespace xsd std::basic_string<C> str; XMLSize_t n; - xml::std_memory_manager mm; + +#ifdef XSD_CXX11 + std::unique_ptr<XMLByte[], xml::std_memory_manager&> r ( +#else auto_array<XMLByte, xml::std_memory_manager> r ( +#endif Base64::encode ( reinterpret_cast<const XMLByte*> (this->data ()), static_cast<XMLSize_t> (this->size ()), @@ -353,9 +363,13 @@ namespace xsd xml::std_memory_manager mm; XMLSize_t size; +#ifdef XSD_CXX11 + std::unique_ptr<XMLByte[], xml::std_memory_manager&> data ( +#else auto_array<XMLByte, xml::std_memory_manager> data ( +#endif Base64::decodeToXMLByte (src, &size, &mm, Base64::Conf_RFC2045), - mm); + mm); if (data) { |