Is it possible to use elements of a different type than contained in a std::set to perform search and deletion?
问题 Let's say I have the following: struct MetadataThingy { void *actual_thingy; int some_metadata; int more_metadata; bool operator<(MetadataThingy const& other) const { return actual_thingy < other.actual_thingy; } }; where actual_thingy points to some data of importance and I want the container ordered by the value of actual_thingy rather than the value of the element pointed at, but I need to store some other data about it, so I created the wrapper class MetadataThingy with a comparator that