Boost logo

Boost Users :

Subject: Re: [Boost-users] [Bind] How to create a functor which returns oneof its arguments?
From: Vadim Guchenko (nomail_at_[hidden])
Date: 2009-12-09 05:20:18


Hello, Roman!
You wrote on Tue, 8 Dec 2009 16:26:58 +0100:

>> Is there a simple way to create a functor that returns one of its
>> arguments _1, _2, ...?
 RP> In Boost.Lambda _2 is a functor that returns its second argument and
 RP> constant(true) is a functor that always returns true. The same works
 RP> with Boost.Phoenix.

Thanks! Boost.Lambda allows to write more compact code than if functors from
the <functional> header are used.

--
Best regards, Vadim Guchenko [yhw at relost dot net]. 

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