Re: [Boost-users] Boost.Lambda: failure to compile with std::set, OK withstd::vector, bug?

4 Jan
2009
4 Jan
'09
5:09 p.m.
Hi,
Compiling the code below with std::vector goes OK, the std::set variant does not compile:
All elements in a std::set are const, so you need to make the print member function const: struct Integer { Integer(int anInt) : integer(anInt){} bool operator<( const Integer& anInteger) const { return integer < anInteger.integer;} void print() const {std::cout << integer << std::endl;} int integer; }; Regards, Anders Dalvander
5950
Age (days ago)
5950
Last active (days ago)
0 comments
1 participants
participants (1)
-
Anders Dalvander