3 ms·
Thanks for listing them! See my comments below. > Nullability What do you think of boost::optional? > Polymorphism unique_ptr is probably the wrong choice h
by wfunction 12y ago
Thanks for listing them!
See my comments below.
> Nullability
What do you think of boost::optional?
> Polymorphism
unique_ptr is probably the wrong choice here. You should be using ptr_vector:
http://stackoverflow.com/questions/9469968 http://stackoverflow.com/questions/9469968
> Reassignment/swap
The indirection and heap (de)allocation also imposes a slowdown, though. Have you actually experienced this to be worth it in some cases, or is this just a guess?
> Release
I don't think this is a valid reason...? This is a pretty common idiom for releasing value types:
Type().swap(existing); // release 'existing'