template typedef



Hi all,

suppose I have a template class like:

template <typename T>
struct X
{
T value;
};

If I need a shared_ptr to this class I declare it like:

std::tr1::shared_ptr<X<char>> XcharPtr;

Is there a way to typedef the first part, so I can do something like:

typedXptr<char> XcharPtr;

I can do it with #defines but there must be a better way...

Thank you

--
Alessandro .



Relevant Pages

  • Re: Message Mapping for a template class
    ... > Does anyone know how to map messages for a template class? ... For even more fun ... ... declare some of the classes involved in a namespace! ...
    (microsoft.public.vc.mfc)
  • Self-referencing templates
    ... I'm having a time wrapping my mind around how this should work. ... I have a template class that has a list of objects of another class. ... What's the correct way to declare that? ... template class TClientHandler; // supposed to be a forward declaration ...
    (comp.lang.cpp)
  • Re: Template of interface?
    ... bonj wrote: ... > How do I declare a template class such that the template class T must ... > interface IProvideID ...
    (microsoft.public.vc.language)
  • Re: Template of interface?
    ... bonj wrote: ... > How do I declare a template class such that the template class T must ... > interface IProvideID ...
    (comp.lang.cpp)
  • Re: static class member variables
    ... > (eg. it's a template class and I don't want users to have to define the ... > static int& v ... returns a dangling reference to the already evaporated local variable. ...
    (comp.lang.cpp)