
4 Nov
2011
4 Nov
'11
10:36 p.m.
Le 04/11/11 17:02, Andrey Semashev a écrit :
On Friday, November 04, 2011 16:51:12 Olaf van der Spek wrote:
Great. Does anyone else have comments / concerns about a (size_t) constructor?
I still don't like the idea. If you really want to add this feature, please retain the current interface intact. You could add a special manipulator to make the allpcation request explicit, like this:
boost::scoped_array< int> p(boost::allocate_count(10));
Here allocate_count is a simple class that holds the size of the array to be allocated. Alternatively, Boost.Parameter could be used, but it is quite heavy for such basic tools like smart pointers.
+1