Reputation: 427
I'm currently trying to port code to Visual Studio 2012 that makes use of template aliases, like this:
template< typename T > using SmartPtr = std::shared_ptr< T >;
However, Visual Studio 2012 does not support template aliases.
Is it possible to replace the above declaration with something equivalent that will not break the code that uses it?
Regards
Upvotes: 2
Views: 566
Reputation: 71
You could try using macros:
#define SmartPtr std::shared_ptr;
works the same as template aliasing on VS2015
Upvotes: 0
Reputation: 20304
template< typename T >
struct SmartPtr
{
typedef std::shared_ptr< T > type;
};
Use it as:
SmartPtr<int>::type
Upvotes: 2