Re: [boost] MPL's "round" lambda

2003-03-10 Thread Terje Slettebø
A few months ago, Aleksey posted a cool way of doing lambda using function notation. I hadn't followed the thread at the time, but I read up on it recently. Like many others, I found it hard to understand how it worked, so I asked Aleksey if he could make a minimal example of it, which he did. For

Re: [boost] MPL's "round" lambda

2002-11-19 Thread David Abrahams
"Peter Dimov" <[EMAIL PROTECTED]> writes: > Other examples that won't work correctly include: > > list(char[]) > list(char[3]) > list(void) Yeah, I had considered using function types as "lightweight type vectors", but gave up for this reason. -- David Abrahams [EMAIL

Re: [boost] MPL's "round" lambda

2002-11-19 Thread Peter Dimov
From: "Aleksey Gurtovoy" <[EMAIL PROTECTED]> > Peter Dimov wrote: > > I wrote "I don't understand how it works even _after_ (briefly) > > looking at the code. ;-)" but then it occured to me that list(int, char, > > long, int) is a function type. > > Yep. > > > Cool trick. Cv qualifiers will probabl

RE: [boost] MPL's "round" lambda

2002-11-19 Thread Aleksey Gurtovoy
Douglas Gregor wrote: > On Monday 18 November 2002 05:56 am, Aleksey Gurtovoy wrote: > > If you are tired of angle brackets in your templates (no, > > it's not a TV commercial :), may be you'll like this one: > > > > typedef eval< > > count_if( > > list(int,char,long,in

Re: [boost] MPL's "round" lambda

2002-11-19 Thread David Abrahams
Aleksey Gurtovoy <[EMAIL PROTECTED]> writes: > Peter Dimov wrote: >> I wrote "I don't understand how it works even _after_ (briefly) >> looking at the code. ;-)" but then it occured to me that list(int, char, >> long, int) is a function type. > > Yep. > >> Cool trick. Cv qualifiers will probabl

Re: [boost] MPL's "round" lambda

2002-11-19 Thread David Abrahams
Aleksey Gurtovoy <[EMAIL PROTECTED]> writes: > David Abrahams wrote: > >> Interesting. Like Dirk, I too am wondering what the point is, >> beyond syntactic sugar. > > What is the point of what exactly? Of yet another lambda notation? > Of round brackets? Of my post? :) > > Anyway, there wasn't muc

RE: [boost] MPL's "round" lambda

2002-11-19 Thread Aleksey Gurtovoy
Peter Dimov wrote: > I wrote "I don't understand how it works even _after_ (briefly) > looking at the code. ;-)" but then it occured to me that list(int, char, > long, int) is a function type. Yep. > Cool trick. Cv qualifiers will probably be a problem They are stripped on non-class rvalues,

RE: [boost] MPL's "round" lambda

2002-11-19 Thread Aleksey Gurtovoy
David Abrahams wrote: > Interesting. Like Dirk, I too am wondering what the point is, beyond > syntactic sugar. What is the point of what exactly? Of yet another lambda notation? Of round brackets? Of my post? :) Anyway, there wasn't much of the point besides demonstrating that something like th

RE: [boost] MPL's "round" lambda

2002-11-18 Thread Rozental, Gennadiy
> On Monday 18 November 2002 05:56 am, Aleksey Gurtovoy wrote: > > If you are tired of angle brackets in your templates (no, > it's not a TV > > commercial :), may be you'll like this one: > > > > typedef eval< > > count_if( > > list(int,char,long,int) > > ,

Re: [boost] MPL's "round" lambda

2002-11-18 Thread Douglas Gregor
On Monday 18 November 2002 05:56 am, Aleksey Gurtovoy wrote: > If you are tired of angle brackets in your templates (no, it's not a TV > commercial :), may be you'll like this one: > > typedef eval< > count_if( > list(int,char,long,int) > , lambda(is_same(_,i

Re: [boost] MPL's "round" lambda

2002-11-18 Thread Peter Dimov
From: "Joel de Guzman" <[EMAIL PROTECTED]> > From: "Peter Dimov" <[EMAIL PROTECTED]> > > From: "Aleksey Gurtovoy" <[EMAIL PROTECTED]> > > > If you are tired of angle brackets in your templates (no, it's not a TV > > > commercial :), may be you'll like this one: > > > > > > typedef eval< > > >

Re: [boost] MPL's "round" lambda

2002-11-18 Thread Joel de Guzman
- Original Message - From: "Peter Dimov" <[EMAIL PROTECTED]> > From: "Aleksey Gurtovoy" <[EMAIL PROTECTED]> > > If you are tired of angle brackets in your templates (no, it's not a TV > > commercial :), may be you'll like this one: > > > > typedef eval< > > count_if( > >

Re: [boost] MPL's "round" lambda

2002-11-18 Thread Peter Dimov
From: "Aleksey Gurtovoy" <[EMAIL PROTECTED]> > If you are tired of angle brackets in your templates (no, it's not a TV > commercial :), may be you'll like this one: > > typedef eval< > count_if( > list(int,char,long,int) > , lambda(is_same(_,int)) >

Re: [boost] MPL's "round" lambda

2002-11-18 Thread David Abrahams
Aleksey Gurtovoy <[EMAIL PROTECTED]> writes: > If you are tired of angle brackets in your templates (no, it's not a TV > commercial :), may be you'll like this one: > > typedef eval< > count_if( > list(int,char,long,int) > , lambda(is_same(_,int)) >

[boost] MPL's "round" lambda

2002-11-18 Thread Aleksey Gurtovoy
If you are tired of angle brackets in your templates (no, it's not a TV commercial :), may be you'll like this one: typedef eval< count_if( list(int,char,long,int) , lambda(is_same(_,int)) ) >::type res; BOOST_STATIC_ASSERT(res::valu