22 Sep
2014
22 Sep
'14
8:42 a.m.
On 13-09-2014 22:52, Aaron Levy wrote:
Consider the following code:
I can create a ptr_set of Base like this:
boost::ptr_set<Base> set;
But I can't create a ptr_map with Base as key, like this:
boost::ptr_map
map; The problem is that Base is abstract and so the key cannot be instantiated by ptr_map. What is the cause for this distinction between ptr_set and ptr_map.
I guess it might be possible, but the work involved was probably large.
The workaround is
boost::ptr_map