Re:Stack, Heap, Pool
by filthydumbidiot on Monday September 14, 2015 @11:54AM
(#10215677)
By explicitly calling the destructor, you could do away with the requirement that classes must implement a "reset()" member function (which, aside from being an extra step for users, does kind of make RAII in their classes somewhat confusing):
acquire() could be improved by using placement new and forwarding the constructor arguments via variadic template:
Finally, you can exchange potential upfront construction cost (and remove the need for a default constructor in user classes) by making an inner dummy struct that matches the size:
[ Parent
| on HN ]
There are no comments on this comment yet.