storing templates in boost::mpl::vector instead of complete types

Hello, is it possible to store templates instead of complete types in boost::mpl::vector? I want to compose a class out of templates: template< typename B, typename E, typename Comp
struct Scattered; template< typename B, typename E, typename Comp
struct Scattered : public mpl::deref< B >::type< Comp >, // <<== inherit from the template, Comp == Special public Scattered< typename mpl::next< B >::type, E, Comp > {}; template< typename E, typename Comp > struct Scattered< E, E, Comp > {}; template< typename Sequence, typename Comp > struct InheritScattered : public detail::Scattered< typename mpl::begin< Sequence >::type, typename mpl::end< Sequence >::type, Comp > {}; template< typename D > class ReadN { void readn() { D & d = static_cast< D & >( * this); d.some_function(); .... } }; template< typename D > class WriteN { void writen() { D & d = static_cast< D & >( * this); ... } }; temlate< typename TL > struct Basic {}; typedef BaiscX< mpl::vector< ReadN, WriteN > > Special; // <<== composing SpecialX (inherit from ReadN which is a template) Special s; s.readn(); s.writen();

<Oliver.Kowalke@infineon.com> writes:
Hello, is it possible to store templates instead of complete types in boost::mpl::vector?
Just store placeholder expressions. mpl::vector<template1<_,_>, template2<_,_> > To instantiate those templates, you just mpl::apply< placeholder_expression, arg1, arg2 >::type I can't easily tell what you're after below, so I don't have a more complete example for you. <snip your code> -- Dave Abrahams Boost Consulting www.boost-consulting.com
participants (2)
-
David Abrahams
-
Oliver.Kowalke@infineon.com