Commit 8009ac66 authored by Dominik Charousset's avatar Dominik Charousset

cow_ptr: fix constructing T* from Y*

parent fbbd3363
...@@ -70,7 +70,7 @@ class cow_ptr : util::comparable<cow_ptr<T> >, ...@@ -70,7 +70,7 @@ class cow_ptr : util::comparable<cow_ptr<T> >,
cow_ptr& operator=(const cow_ptr&) = default; cow_ptr& operator=(const cow_ptr&) = default;
template<typename Y> template<typename Y>
cow_ptr(cow_ptr<Y> other) : m_ptr(other.m_ptr.release()) { cow_ptr(cow_ptr<Y> other) : m_ptr(other.get()) {
static_assert(std::is_convertible<Y*, T*>::value, static_assert(std::is_convertible<Y*, T*>::value,
"Y* is not assignable to T*"); "Y* is not assignable to T*");
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment