Template with partially bound arguments as template template-argument

Template with partially bound arguments as template template-argument

Post by Mathias Ga » Wed, 09 Sep 2009 09:53:48



I suggest you take a look at Boost.MPL, which provides that kind of
facilities in C++03.
You can do partial meta-function application, meta-function
composition, write lambda expressions with placeholders, etc.

(A meta-function is a template that takes N types and returns one as a
member typedef named "type", like type traits)


--
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@netlab.cs.rpi.edu]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.yqcomputer.com/ ]
 
 
 

Template with partially bound arguments as template template-argument

Post by SG » Wed, 09 Sep 2009 09:56:17


You will like the new type alias syntax that C++0x offers and supports
templates as well:

using blah = int; // like typedef int blah;

template<class A, class B> class blah;

template<class A>
using blahAint = blah<A,int>;

blahAint can be used as a template<class> template parameter as far as
I know.

Cheers!
SG

--
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@netlab.cs.rpi.edu]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.yqcomputer.com/ ]