Re: [boost] Re: Hello MPL world!

2003-01-11 Thread Howard Hinnant
On Saturday, January 11, 2003, at 09:42 AM, Beman Dawes wrote: >Or maybe even just: > > template > struct my_container > : if_::value, impl1, impl2>::type > { > ... > }; These are the examples that resonate with me, particularly Howard's version. It looks so easy, and has o

Re: [boost] Re: Hello MPL world!

2003-01-11 Thread David Abrahams
Howard Hinnant <[EMAIL PROTECTED]> writes: > On Saturday, January 11, 2003, at 09:42 AM, Beman Dawes wrote: > >> >Or maybe even just: >> > >> > template >> > struct my_container >> > : if_::value, impl1, impl2>::type >> > { >> > ... >> > }; >> >> These are the examples that res

Re: [boost] Re: Hello MPL world!

2003-01-11 Thread Beman Dawes
At 10:17 PM 1/6/2003, Howard Hinnant wrote: >On Monday, January 6, 2003, at 06:50 PM, David Abrahams wrote: > >> OK, I see your point. How about: >> >> template >> struct my_container >> : if_< >> and_< >>is_pointer >> , is_POD > >>> >>

[boost] Re: Hello MPL World!

2003-01-07 Thread Augustus Saunders
Since I was fairly recently starting with MPL, I thought I would chime in here. If MPL had to be installed and configured, then I would be more concerned with a Hello, World example. In my opinion, the point of Hello, World type programs was just to verify that your toolchain was set up properl

Re: [boost] Re: Hello MPL world!

2003-01-07 Thread Greg Colvin
At 05:09 PM 1/6/2003, David B. Held wrote: >"David Abrahams" <[EMAIL PROTECTED]> wrote in message >[EMAIL PROTECTED]">news:[EMAIL PROTECTED]... >> Howard Hinnant <[EMAIL PROTECTED]> writes: >> >> OK, I see your point. How about: >> >> template >> struct my_container >> : if_< >>

Re: [boost] Re: Hello MPL world!

2003-01-07 Thread David Abrahams
"Yitzhak Sapir" <[EMAIL PROTECTED]> writes: > The original version I suggested used fold, and for that, you do > need to use if_ since you need to determine whether to call > Prev::eval(). I didn't post my implementation since it took me > quite a while to get it working with VC6.5 and I thought

RE: [boost] Re: Hello MPL world!

2003-01-07 Thread Yitzhak Sapir
> -Original Message- > From: David B. Held [mailto:[EMAIL PROTECTED]] > Sent: Monday, January 06, 2003 8:14 PM > To: [EMAIL PROTECTED] > Subject: [boost] Re: Hello MPL world! > > While this is a cute idea, my first impression would be: "Uh...is this > reall

Re: [boost] Re: Hello MPL world!

2003-01-06 Thread David Abrahams
Howard Hinnant <[EMAIL PROTECTED]> writes: > On Monday, January 6, 2003, at 06:50 PM, David Abrahams wrote: > > Or maybe even just: > >template >struct my_container > : if_::value, impl1, impl2>::type ^^^ you'd have to drop that part (yes, it's magic ). >

Re: [boost] Re: Hello MPL world!

2003-01-06 Thread Joel de Guzman
- Original Message - From: "Greg Colvin" <[EMAIL PROTECTED]> > At 08:19 PM 1/6/2003, Joel de Guzman wrote: > >- Original Message - > >From: "David Abrahams" <[EMAIL PROTECTED]> > >... > >> > P.S. Outputting "Hello, world" in a way that generates significantly > >> > more code th

Re: [boost] Re: Hello MPL world!

2003-01-06 Thread Greg Colvin
At 08:19 PM 1/6/2003, Joel de Guzman wrote: >- Original Message - >From: "David Abrahams" <[EMAIL PROTECTED]> >... >> > P.S. Outputting "Hello, world" in a way that generates significantly >> > more code than the run-time version is probably not a good way to >> > endear users to metaprogr

Re: [boost] Re: Hello MPL world!

2003-01-06 Thread Joel de Guzman
- Original Message - From: "David Abrahams" <[EMAIL PROTECTED]> > "David B. Held" <[EMAIL PROTECTED]> writes: > > > "David Abrahams" <[EMAIL PROTECTED]> wrote in message > > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > >> Yitzhak Sapir <[EMAIL PROTECTED]> writes: > >> > >> > I think s

Re: [boost] Re: Hello MPL world!

2003-01-06 Thread Howard Hinnant
On Monday, January 6, 2003, at 06:50 PM, David Abrahams wrote: OK, I see your point. How about: template struct my_container : if_< and_< is_pointer , is_POD > , impl1 , impl2 ::type { ... }; Or maybe even just

[boost] Re: Hello MPL world!

2003-01-06 Thread David B. Held
"David Abrahams" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Howard Hinnant <[EMAIL PROTECTED]> writes: > > OK, I see your point. How about: > > template > struct my_container > : if_< > and_< >is_pointer > ,

Re: [boost] Re: Hello MPL world!

2003-01-06 Thread David Abrahams
Howard Hinnant <[EMAIL PROTECTED]> writes: > I would be careful that your target audience doesn't look at the > "helloworld" and say, gee, why don't I just use existing language > features: > >template >struct my_container >{ > // impl2 ... >}; > >template >struct my

Re: [boost] Re: Hello MPL world!

2003-01-06 Thread Howard Hinnant
On Monday, January 6, 2003, at 01:14 PM, David B. Held wrote: While this is a cute idea, my first impression would be: "Uh...is this really something I could use in my own code?" On the other hand, I seem to use compile-time if more than anything else, even in "user code". I suspect that most

Re: [boost] Re: Hello MPL world!

2003-01-06 Thread Terje Slettebø
>From: "Alisdair Meredith" <[EMAIL PROTECTED]> > Terje Slettebø wrote: > > > The results don't necessarily have to be printed out at > > compile-time (Erwin Unruh printed the results using compiler-warnings, but > > that is of course highly implementation dependent). > > > "Hello, world" in compil

Re: [boost] Re: Hello MPL world!

2003-01-06 Thread David Abrahams
"David B. Held" <[EMAIL PROTECTED]> writes: > "David Abrahams" <[EMAIL PROTECTED]> wrote in message > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... >> Yitzhak Sapir <[EMAIL PROTECTED]> writes: >> >> > I think storing the text "Hello world!" in a vector >> > [...] >> > And then using functors to pri

[boost] Re: Hello MPL world!

2003-01-06 Thread David B. Held
"David Abrahams" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Yitzhak Sapir <[EMAIL PROTECTED]> writes: > > > I think storing the text "Hello world!" in a vector > > [...] > > And then using functors to print it such as: > [...] While this is a cute idea, my

[boost] Re: Hello MPL world!

2003-01-06 Thread Alisdair Meredith
David Abrahams wrote: > My current working idea is really simple: > > struct impl1 { ... }; > struct impl2 { ... }; > > template > struct my_container : if_, impl1, impl2>::type > { > ... > }; > > This is something I want to do all the time; it lets you swap out a > completely

Re: [boost] Re: Hello MPL world!

2003-01-06 Thread David Abrahams
Alisdair Meredith <[EMAIL PROTECTED]> writes: > Terje Slettebø wrote: > >> The results don't necessarily have to be printed out at >> compile-time (Erwin Unruh printed the results using compiler-warnings, but >> that is of course highly implementation dependent). > >> "Hello, world" in compile-tim

[boost] Re: Hello MPL world!

2003-01-06 Thread Alisdair Meredith
Terje Slettebø wrote: > The results don't necessarily have to be printed out at > compile-time (Erwin Unruh printed the results using compiler-warnings, but > that is of course highly implementation dependent). > "Hello, world" in compile-time programming doesn't necessarily have to be > the same