
15 Oct
2010
15 Oct
'10
12:38 a.m.
2010/10/14 Gerardo Hernández <g.hernandez@indizen.com>:
The problem is that the underlying type of boost::ptr_vector<T> is always vector<void*>, no matter T is const.
Since the point of this is to only ever instantiate one version of the underlying container, wouldn't it be better to always use underlying_container<void const*>, then const_cast when returning to the user? Since we know we had a pointer to non-const at some point, the const_casts would all be legal, afaik. (const_cast atop an underlying_container<void*> would not be.) ~ Scott