diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2016-06-15 18:48:14 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2016-06-15 18:48:14 +0200 |
commit | b33321c4d05c0ac759bf3fcf647a568af8bfca0c (patch) | |
tree | 1f64b98e8560930c6b317124a0e531173d0359cb | |
parent | 208f464e058974ea2c27ded655aaf4f88825d46a (diff) |
Fix bug in std::unique_ptr deleter mapping
-rw-r--r-- | odb/pointer-traits.hxx | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/odb/pointer-traits.hxx b/odb/pointer-traits.hxx index dc10205..a20aa93 100644 --- a/odb/pointer-traits.hxx +++ b/odb/pointer-traits.hxx @@ -235,16 +235,16 @@ namespace odb // Specialization for C++11 std::unique_ptr. // - template <typename T, typename D> - class pointer_traits<std::unique_ptr<T, D>> + template <typename T, template <typename> class D> + class pointer_traits<std::unique_ptr<T, D<T>>> { public: static const pointer_kind kind = pk_unique; static const bool lazy = false; typedef T element_type; - typedef std::unique_ptr<element_type, D> pointer_type; - typedef std::unique_ptr<const element_type, D> const_pointer_type; + typedef std::unique_ptr<T, D<T>> pointer_type; + typedef std::unique_ptr<const T, D<const T>> const_pointer_type; typedef smart_ptr_guard<pointer_type> guard; static element_type* @@ -271,16 +271,16 @@ namespace odb // Note: transfers ownership. // template <typename T1> - static std::unique_ptr<T1> + static std::unique_ptr<T1, D<T1>> static_pointer_cast (pointer_type& p) { - return std::unique_ptr<T1> (static_cast<T1*> (p.release ())); + return std::unique_ptr<T1, D<T1>> (static_cast<T1*> (p.release ())); } // Note: transfers ownership if successful. // template <typename T1> - static std::unique_ptr<T1> + static std::unique_ptr<T1, D<T1>> dynamic_pointer_cast (pointer_type& p) { T1* p1 (dynamic_cast<T1*> (p.get ())); @@ -288,7 +288,7 @@ namespace odb if (p1 != 0) p.release (); - return std::unique_ptr<T1> (p1); + return std::unique_ptr<T1, D<T1>> (p1); } public: |