Boost logo

Boost :

Subject: Re: [boost] std::map<> - like structure for other than std::pair<>?
From: David Hagood (david.hagood_at_[hidden])
Date: 2015-04-15 07:23:22


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.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk