8 Oct
2015
8 Oct
'15
2:48 p.m.
Hi Gavin On 10/08/2015 03:01 PM, Peter Dimov wrote:
Karolin Varner wrote:
For std::shared_ptr and the other pointers we might still emulate a moving cast in order to facilitate generic programming.
Like Gavin, I'm not sure I quite see the point of using dynamic_pointer_cast on an rvalue in generic code, because if it fails, the original is lost.
Yeah, I was thinking of using an implementation, where the input pointer would only be moved, if the cast is successful. In case the cast wasn't successfully. we could return a NULL pointer and leave the input as it was. Best, Karolin