[pooma-dev] Using template template parameters in new code ok?

Stephen Smith sasmith at cybermesa.com
Wed Nov 20 16:23:30 UTC 2002


That's all there is too it.  In fact, people had often commented that some 
code would
be cleaner with template template.  It is a pretty recent addition to many 
compilers.

Rather than write:

template <template <class T> class X>
class A { //...
    X<int> myFunctor;
};

We would define a requirement for an external traits-like class and use a tag:

template <class X>
class A { //...
   MyFunctor<X,int> myFunctor;
};

You'll find patterns like this all over POOMA.

     Stephen

At 07:15 AM 11/20/2002 -0800, Jeffrey Oldham wrote:
>Richard Guenther wrote:
>>Hi!
>>I wonder wether using template template parameters in new code
>>is ok? I didnt find any existing code in pooma using this C++
>>feature, maybe not without reason?
>>Thanks for clarifying, Richard.
>
>In the past, some C++ compilers did not correctly handle template template 
>parameters, but I guess that is no longer the case.  May be James 
>Crotinger can provide a little history on any decisions?
>
>Thanks,
>Jeffrey D. Oldham
>oldham at codesourcery.com
>






More information about the pooma-dev mailing list