Boost logo

Boost Users :

From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2008-07-28 13:20:38


AMDG

noman javed wrote:
> I want to apply some arbitrary function F on each element of a
> sequence through myfun class inherited from transform_view. I am
> unable to output the elements of the resultant sequence. Below is the
> whole code of my program
>

mpl::transform_view takes an MPL lambda expression rather than a
function object,
because it operates on types, not objects. (most MPL constructs take lambda
expressions--mpl::for_each is a special case)

#include <boost/mpl/times.hpp>
...
typedef myfun<mpl::times<mpl::_1, mpl::_1>,numbers>::type newnum;

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