Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#6 algorithm Loki::TL::Transform often need

open
nobody
None
5
2014-08-20
2005-12-16
archimag
No

namespace Loki { namespace TL {
template <class TList, template <class> class form>
struct Transform;

template <class T, template <class> class form>
struct Transform<Loki::Typelist<T, Loki::NullType>,
form > {
typedef typename Loki::TL::MakeTypelist<form<T>
>::Result Result;
};

template <class T, class U, template <class> class
form>
struct Transform<Loki::Typelist<T, U>, form > {
typedef typename Loki::TL::Append<typename
Loki::TL::Maketypelist<form<T> >::Result,typename
Transform<U, form>::Result>::Result Result;
};
} }

Example:
typedef Loki::Tuple<Loki::TL::Transform<typename
Loki::TL::MakeTypelist<MyClass1, MyClass2>::Result,
boost::shared_ptr>::Result > tuple_type;

Discussion