views:

34

answers:

2

using template classes I usually make some typedefs like:

typedef super<puper<complex<template<type> > > > simple_name

I usually do it in 2 ways:

template <class A, ...>
struct Types {
    typedef ...
}

template <class A, ...>
class Part_Of_Logick {
    public:
        typedef ...
}

Is it possible to set typedefs at the global scope? like this:

template <class A, ...>
typedef ...
+3  A: 

I understand that you mean writing a templated typedef that will create a second template with some of the arguments of the first template fixed. If that is the question, no, not in the current standard. In the upcoming c++0x standard you will be able to do:

template <typename A, typename B> a_template;
template <typename T>
using other_template = a_template<T, int>;
David Rodríguez - dribeas
+2  A: 

Not in C++98. C++0x will support this. I can't exactly recall the C++0x syntax, though.

Cheers & hth.,

– Alf

Alf P. Steinbach