Boost logo

Boost :

Subject: Re: [boost] [smart_ptr] Moving cast for unique_ptr
From: Karolin Varner (karo_at_[hidden])
Date: 2015-12-21 07:10:03


I have created a pull request based on the discussion in this thread:
It doesn't yet contain optimizations for copyable pointers, but it contains pointer_cast overloads for std::shared_ptr and std::unique_ptr.

Since this came up in this thread, I also created a motivating example for static_pointer_cast(std::unique_ptr<...>&&) and dynamic_pointer_cast(std::unique_ptr<...>&&)

It also seems that, even there are no overloads with move semantics for shared_ptr, calling the pointer casts with std::move(...) works. So in principle we could use move(...) for those and implement optimizations later.
Though I am not quite convinced, that this is good behavior.


Boost list run by bdawes at, gregod at, cpdaniel at, john at