Topic: Comparison operators in STL container classes


Author: Jim Harris <jrharr@rstcorp.com>
Date: 1997/11/04
Raw View
I'm currently using a version of ObjectSpace's STL implementation with
Visual C++ 4.0.  I'm having problems compiling code that contains the
following container declaration:

map< string, smart_ptr< obj >, less< string > > m_map;

This implementation of STL requires that both the key (string) and value
(smart_ptr< obj >) classes implement the less-than operator.  I'm having
problems finding anything in the standard that specifies that a "value"
class must implement the less-than operator.  Should I expect all
implementations of STL to require a less-than operator for "value"
classes in map/multimap objects?

Jim Harris
---
[ comp.std.c++ is moderated.  To submit articles: try just posting with      ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu         ]
[ FAQ:      http://reality.sgi.com/employees/austern_mti/std-c++/faq.html    ]
[ Policy:   http://reality.sgi.com/employees/austern_mti/std-c++/policy.html ]
[ Comments? mailto:std-c++-request@ncar.ucar.edu                             ]