Boost logo

Boost Users :

From: Lucio Flores (dogboy_l_at_[hidden])
Date: 2006-05-09 14:01:32


--- David Abrahams <dave_at_[hidden]> wrote:

> Lucio Flores <dogboy_l_at_[hidden]> writes:
>
> > --- David Abrahams <dave_at_[hidden]> wrote:
> >
> >> Lucio Flores <dogboy_l_at_[hidden]> writes:
> >>
> >> > I posted this question a few months ago, but I got pulled away to deal
> with
> >> > more pressing work issues. So here it goes again:
> >> >
> >> > I'm trying to use lambda expressions to implement 'twice'. So I came up
> >> with
> >> >
> >> >
> >> > typedef mpl::apply<_1, mpl::apply<_1, _2> > lambda_type;
> >> >
> >> > typedef lambda_type<boost::add_pointer<_1>, int> result_type;
> >>
> >> Surely that doesn't compile(?) lambda_type is a type; you can't follow
> >> it with a template argument list.
> >>
> >
> > You're right! .... But it did compile....
>
> What compiler ate that without complaint?

gcc version 3.3.5 20050117 (prerelease) (SUSE Linux 9.3)

But the following wont compile:

typedef mpl::apply<_1, mpl::apply<_1, _2> > lambda_type;
typedef mpl::apply<lambda_type, boost::add_pointer<_1>, int>::type answer_type;

prog_3_6.cpp:22: error: no class template named `apply' in `struct lambda_type'
prog_3_6.cpp:22: error: syntax error before `;' token

-------------------------------------------

Manson: My philosophy is: Don't think. I don't believe in the mind that you think with and scheme with. I don't believe in words.

Reporter: If you don't believe in words, why do you use so many of them?

Manson: Words are symbols. All I'm doing is jumbling the symbols in your brain. Everything is symbolic. Symbols are just connections in your brain. Even your body is a symbol.

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com


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