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
"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
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
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
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
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
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,
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
> 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)
> > ,
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
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<
> > >
- 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(
> >
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))
>
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))
>
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
15 matches
Mail list logo