diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2016-11-14 15:24:14 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2016-11-14 15:24:14 +0200 |
commit | 44fde85b2496750b78939247d1d19a67c5b3dc71 (patch) | |
tree | cb7f87c14037727ddc89bb7499457b5e3207ad98 /cutl/shared-ptr/base.hxx | |
parent | 7945c1771bbb57125b3e3343fa84bfc314e0f4d4 (diff) |
C++11-compatibility fixes and improvements
Diffstat (limited to 'cutl/shared-ptr/base.hxx')
-rw-r--r-- | cutl/shared-ptr/base.hxx | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/cutl/shared-ptr/base.hxx b/cutl/shared-ptr/base.hxx index f2bfecc..5eb1032 100644 --- a/cutl/shared-ptr/base.hxx +++ b/cutl/shared-ptr/base.hxx @@ -10,11 +10,12 @@ #include <cutl/exception.hxx> +#include <cutl/details/config.hxx> #include <cutl/details/export.hxx> namespace cutl { - struct LIBCUTL_EXPORT share + struct share { explicit share (char id); @@ -30,18 +31,23 @@ namespace cutl extern LIBCUTL_EXPORT cutl::share shared; extern LIBCUTL_EXPORT cutl::share exclusive; +#ifdef LIBCUTL_CXX11 +LIBCUTL_EXPORT void* +operator new (std::size_t, cutl::share); +#else LIBCUTL_EXPORT void* operator new (std::size_t, cutl::share) throw (std::bad_alloc); +#endif LIBCUTL_EXPORT void -operator delete (void*, cutl::share) throw (); +operator delete (void*, cutl::share) LIBCUTL_NOTHROW_NOEXCEPT; namespace cutl { struct LIBCUTL_EXPORT not_shared: exception { virtual char const* - what () const throw (); + what () const LIBCUTL_NOTHROW_NOEXCEPT; }; struct LIBCUTL_EXPORT shared_base @@ -60,14 +66,19 @@ namespace cutl std::size_t _ref_count () const; +#ifdef LIBCUTL_CXX11 + void* + operator new (std::size_t, share); +#else void* operator new (std::size_t, share) throw (std::bad_alloc); +#endif void - operator delete (void*, share) throw (); + operator delete (void*, share) LIBCUTL_NOTHROW_NOEXCEPT; void - operator delete (void*) throw (); + operator delete (void*) LIBCUTL_NOTHROW_NOEXCEPT; protected: std::size_t counter_; |