Joaquín Mª López Muñoz wrote:
bool operator<(const Observation &rhs);
There's an error here (though it's not the primary error, and it might be the case you've got it right in your original code): operator< should be const.
You're right - about the only thing I did correctly was make operator< const! Joaquín Mª López Muñoz wrote:
The code will dynamically create thousands of these things to be used in many ways, so I've opted to use shared_ptr: typedef boost::shared_ptr<Observation> SharedObservation; [...] If I write: typedef boost::multi_index_container<SharedObservation> ObservationCollection;
This is probably not what you meant: [...] Change the code to
void AnotherClass::functionUsingCollection(data) { master_collection.find(Observation(data)); ...
and be done (hopefully). Hope this helps. Please report back.
Joaquín M López Muñoz Telefónica, Investigación y Desarrollo
You were exactly right about my intent and the fix. The recommended fix works exactly as I intended. -- View this message in context: http://www.nabble.com/Newbie-MultiIndex-shared_ptr-non-trivial-class-questio... Sent from the Boost - Users mailing list archive at Nabble.com.