C ++ does not yet have a "typedefs template" where you can "rename" such a template. This function is added in C ++ 0x, where such a "typedef" is called an "alias pattern".
The simplest workaround that works today is to use a class template with a nested typedef:
template <typename T>
struct SharedPtr
{
typedef std::shared_ptr<T> Type;
};
typename SharedPtr<int>::Type sp;
source
share