[parameter] Named Template Parameter

Hi, I'm adventuring through the named template parameter support in the parameter library, using the test ntp.cpp as a documentation. But, AFAICS, there's no support for named template template parameters, is that right? Couldnt it be possible to add such feature? I think it is possible if we use a different binding and an template_template_keyword (or with another name) ? the parameter requirements would be different though.... I could code this support if there would be a support on how to do it (what would it break and etc?) I'm really needing this feature ASAP. Thanks, -- Felipe Magno de Almeida

Felipe Magno de Almeida <felipe.m.almeida@gmail.com> writes:
Hi,
I'm adventuring through the named template parameter support in the parameter library, using the test ntp.cpp as a documentation. But, AFAICS, there's no support for named template template parameters, is that right?
Couldnt it be possible to add such feature? I think it is possible if we use a different binding and an template_template_keyword (or with another name) ?
The problem is that they can't be mixed with other template parameter kinds, so it's really hard (i.e. impossible) to get order independence unless you have a bunch of adjacent named TTPs. I suggest you first consider asking users to pass MPL lambda expressions instead: with_ntp< container_is<std::vector<mpl::_> >, ... > That will deal with the problem with default arguments to class templates along the way (std::vector takes 2). -- Dave Abrahams Boost Consulting www.boost-consulting.com

On 2/14/06, Felipe Magno de Almeida <felipe.m.almeida@gmail.com> wrote:
Hi,
I'm adventuring through the named template parameter support in the parameter library, using the test ntp.cpp as a documentation. But, AFAICS, there's no support for named template template parameters, is that right?
Sorry! It does support template template parameters. All that is needed is wrap the template template parameter in a type: struct tag {}; template <template<typename> class T> class wrap { template <typename ApplyT> struct apply { typedef T<ApplyT> type; }; }; template <template<typename> class T> struct a0_is : parameter::template_keyword<tag, wrap<T> > {}; And just use the tag again in the parameter:parameters. It would be a very addition to a "tips section" in the documentation. [snip] -- Felipe Magno de Almeida
participants (2)
-
David Abrahams
-
Felipe Magno de Almeida