15 Apr
2015
15 Apr
'15
11:23 a.m.
One problem I see with using a set is that the whole data type is used as the key - if you do a find you have to supply the whole data type, not just the key, even though a custom compare operator may only consider part of the object as the key (to use the example use case I gave, you would have to supply a whole CF::Property to the find() function, not just the string). The data elements being const isn't really a problem - if you can remove and replace, it's almost as good as the elements being non-const, and it would be hard for a container to require the key element of the data to be const (so the sorting order of the list is not screwed up), but allow modification of the rest of the item.