You cannot use a "templated typedef", but you can use a convenience class/struct with an inner type:
template<typename T>
struct TypeHelper{
typedef std::vector<T,gc_allocator<T> > Vector;
};
and then use in your code
TypeHelper<MyType>::Vector v;
TypeHelper<MyType>::Vector::iterator it;
And something similar for the map:
template<typename K,typename V>
struct MapHelper{
typedef std::map<K, V, gc_allocator<K,V> > Map;
};
EDIT - @Vijay: I don't know if there's another possible workaround, that's how I would do it; a macro might give you a more compact notation, but personally I wouldn't like it:
#define GCVECTOR(T) std::vector<T,gc_allocator<T> >
EDIT - @chmike: Please note that the TypeHelper
solution does not require you to redefine constructors!