RE: [boost] [MPL] Making Generators

2002-12-17 Thread Aleksey Gurtovoy
David Abrahams wrote: > Aleksey Gurtovoy <[EMAIL PROTECTED]> writes: > > Okay, from this moment MPL's lambda supports "reduced" > > metafunction form directly (if detected): > > > > template< typename T > struct her > > { > > // no 'type' member! > > }; > > > > typedef lamb

Re: [boost] [MPL] Making Generators

2002-12-17 Thread David Abrahams
Aleksey Gurtovoy <[EMAIL PROTECTED]> writes: > Aleksey Gurtovoy wrote: >> David A. Greene wrote: >> > Thanks for considering this. I think it will be quite >> > useful. I look forward to seeing what you come up with! >> >> Well, it turned out to be a little bit more complicated than >> I had

RE: [boost] [MPL] Making Generators

2002-12-17 Thread Aleksey Gurtovoy
Aleksey Gurtovoy wrote: > David A. Greene wrote: > > Thanks for considering this. I think it will be quite > > useful. I look forward to seeing what you come up with! > > Well, it turned out to be a little bit more complicated than > I had foreseen, so it's not there yet. Please stay tuned! O

RE: [boost] [MPL] Making Generators

2002-12-09 Thread Aleksey Gurtovoy
David A. Greene wrote: > Aleksey Gurtovoy wrote: > > It _is_ possible to implement a single template along the > > lines of the SHAZAM template you've mentioned early in the > > thread: > > > > template > > struct my_type { ... } // Note: no ::type member > > > > typedef SHAZAM > g

Re: [boost] [MPL] Making Generators

2002-12-07 Thread David A. Greene
Aleksey Gurtovoy wrote: That's because the MPL's lambda works only with metafunctions which template parameters are _types_, and only types: That's what I suspected. 3) a metafunction with template template parameter, can't be used in lambda expressions: Again, what I suspected. It _is_ p

RE: [boost] [MPL] Making Generators

2002-12-07 Thread Aleksey Gurtovoy
David A. Greene wrote: > But consider this testcase: > > //#define CT_DEBUG > > //#include "ct_print.hh" > #include > #include > > template > struct my_type { > }; > > template > struct my_type_generator { >typedef my_type type; > }; > > template class Base, >typename T, typename

Re: [boost] [MPL] Making Generators

2002-12-06 Thread David A. Greene
Aleksey Gurtovoy wrote: my_type is not a metafunction so maybe it just can't be used conveniently with mpl. Not now. However, I constantly keep finding more and more use cases to be inclined to provide a built-in library support for this particular metafunction's form - in particular, so that

Re: [boost] [MPL] Making Generators

2002-12-06 Thread David A. Greene
David Abrahams wrote: I suppose not. What I really wanted was the ability to take a regular old template class and create a generator out of it: template struct my_type { ... } // Note: no ::type member typedef SHAZAM > generator; typedef generator::template apply::type my_type_inst; I want

RE: [boost] [MPL] Making Generators

2002-12-06 Thread Aleksey Gurtovoy
David A. Greene wrote: > [Posted to boost because MPL is not yet released. At what > point should these questions go to boost-users?] It's mainly the content of the message that determines whether it should be posted here or to the Boost Users list; the status of the library - is it in developm

Re: [boost] [MPL] Making Generators

2002-12-05 Thread David Abrahams
"David A. Greene" <[EMAIL PROTECTED]> writes: > David Abrahams wrote: > >>>Your correction above makes everything clear to me now. >> So do you feel you need an additional library feature? ;-) > > I suppose not. What I really wanted was the ability to take a > regular old template class and crea

Re: [boost] [MPL] Making Generators

2002-12-05 Thread David A. Greene
David Abrahams wrote: Your correction above makes everything clear to me now. So do you feel you need an additional library feature? ;-) I suppose not. What I really wanted was the ability to take a regular old template class and create a generator out of it: template struct my_type { ...

Re: [boost] [MPL] Making Generators

2002-12-05 Thread David Abrahams
"David A. Greene" <[EMAIL PROTECTED]> writes: >> So do you feel you need an additional library feature? > > That's what I'm trying to find out. It seems like most of the > stuff is there already in MPL placeholders and binders. > >>>Plus your solution here doesn't bind T to a type. :) >> Are you

Re: [boost] [MPL] Making Generators

2002-12-05 Thread David A. Greene
David Abrahams wrote: template struct my_type_generator { typedef my_type type; }; lambda does it Oops, I meant lambda > of course! Ok, that makes more sense now. :) , unless of course your compiler needs BOOST_MPL_AUX_LAMDA_SUPPORT. I don't think it's much of

Re: [boost] [MPL] Making Generators

2002-12-05 Thread David Abrahams
"David A. Greene" <[EMAIL PROTECTED]> writes: > >> template >> struct my_type_generator >> { >> typedef my_type type; >> }; >> lambda does it Oops, I meant lambda > of course! > , unless of course your compiler >> needs BOOST_MPL_AUX_LAMDA_SUPPORT. I don't think i

RE: [boost] [MPL] Making Generators

2002-12-05 Thread Iain K.Hanson
> [mailto:[EMAIL PROTECTED]]On Behalf Of David A. Greene > Sent: 05 December 2002 16:56 > > > Is the problem that my_type doesn't contain a ::type > member? my_type is not a metafunction so maybe it just > can't be used conveniently with mpl. IIRC mpl::lambda does need metafunctions to wor

Re: [boost] [MPL] Making Generators

2002-12-05 Thread David A. Greene
David Abrahams wrote: template struct my_type_generator { template struct apply { typedef my_type type; }; }; Looks good to me. Is there a convenient way to create this with MPL? You want it to be more convenient than that?! Perhaps "convenient" is the wrong word. There a

Re: [boost] [MPL] Making Generators

2002-12-05 Thread David Abrahams
"David A. Greene" <[EMAIL PROTECTED]> writes: > [Posted to boost because MPL is not yet released. At what > point should these questions go to boost-users?] > > Say I have a type my_type: > > template > struct my_type { ... } > > Now let's say I want to create a generator that > binds T to some