Browse Source

[Minor] Try to fix compiler specific issue

tags/3.1
Vsevolod Stakhov 2 years ago
parent
commit
f16c34d109
1 changed files with 2 additions and 2 deletions
  1. 2
    2
      src/libutil/cxx/local_shared_ptr.hxx

+ 2
- 2
src/libutil/cxx/local_shared_ptr.hxx View File

@@ -100,7 +100,7 @@ private:
ptr = nullptr;
}
public:
explicit ptr_and_refcnt(T *_ptr, D d = std::default_delete<T>()) : ptr(_ptr),
explicit ptr_and_refcnt(T *_ptr, D &&d = std::default_delete<T>()) : ptr(_ptr),
deleter(std::move(d)) {}
virtual ~ptr_and_refcnt() = default;
};
@@ -128,7 +128,7 @@ public:
// custom deleter
template<class Y, class D, typename std::enable_if<
std::is_convertible<Y*, element_type*>::value, bool>::type = true>
explicit local_shared_ptr(Y* p, D d) : px(p), cnt(new detail::ptr_and_refcnt(p, std::move(d)))
explicit local_shared_ptr(Y* p, D &&d) : px(p), cnt(new detail::ptr_and_refcnt(p, std::forward<D>(d)))
{
}


Loading…
Cancel
Save