Something about std::list<> member functions.

Jonathan Wakely cow@compsoc.man.ac.uk
Mon Aug 11 13:32:00 GMT 2003


On Mon, Aug 11, 2003 at 06:55:22PM +0530, Dhruv Matani wrote:

> > struct less {
> >     template<class T>
> >      bool operator()(const T& const a, const T& const b ) const
> >      { return a < b; }
> > };
> > 
> > Note the extra const's on a and b.  I don't remember the gory details
> > on why this was needed, though.
> > 
> Is this standards compliant?

No.
http://www.parashift.com/c++-faq-lite/const-correctness.html#faq-18.7

jon

--
"The tools we use have a profound (and devious!) influence on our
 thinking habits, and, therefore, on our thinking abilities."
	- Edsger Dijkstra



More information about the Libstdc++ mailing list