3 ms·
You still need to dereference the `value_ptr` a lot, right? Otherwise argument dependent lookup won't work for the wrapped value type. I guess you could provid
by humanrebar 9y ago
You still need to dereference the `value_ptr` a lot, right? Otherwise argument dependent lookup won't work for the wrapped value type.
I guess you could provide specializations for all the common candidates (begin, end, swap, size, empty, data, and whatever gets added in the future) in the "valuable" namespace, but you'll need to be pretty aggressive with adding new specializations as people find ones they need.
Also, it might be a good idea to support a Deleter template parameter and propagate it to the underlying `unique_ptr`. Some projects use that customization point for various purposes, like instrumentation of (de)allocation or grabbing certain kinds of objects from memory pools.