Boost logo

Boost Users :

Subject: Re: [Boost-users] [lambda] lambda member access
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2009-01-29 14:00:40


AMDG

Micha³ Nowotka wrote:
> void clean_data (MyMap& map)
> {
> remove_if(map.begin(), map.end(), (&lambda::_1 )->*(&pair< X* const,
> double >::second) <= m_epsilon);
> }
>
> where:
>
> typedef std::map<const X*,double> MyMap;
>

The keys in a map are immutable. remove_if tries to assign to the
sequence elements.

In Christ,
Steven Watanabe


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net