$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
Subject: Re: [Boost-users] Boost.Lambda: failure to compile with std::set, OK withstd::vector, bug?
From: Anders Dalvander (boost_at_[hidden])
Date: 2009-01-04 12:09:47
> 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