2017-06-25 20:24 GMT+02:00 'Walt Karas' via ISO C++ Standard - Future
Proposals <
std-pr...@isocpp.org>:
> The reference implementation would be:
>
> template <typename T> reset(T &v) { T tmp{static_cast<T &&>(v)}; }
>
> It releases any dynamically-allocated resources held by an object, leaving
> it in a safe state to be assigned or destroyed.
What would it mean when T is a built-in pointer? How would reset
discriminate a pointer that owns or that doesn't own a resource? Is
reset to be intended to be a customization point? As you describe it
it sounds so trivial that I'm not sure why it would be worth
standardizing it. Could you elaborate a bit about realistic
optimization choices that could be realized by a Library
implementation but not by a third-party component that provides that
feature? Does there exists something like that in Boost or some other
library?
Thanks,
- Daniel