在vs2005上一切都很好,但在vs2013上是行不通的。 我有代碼:C++模板,從vc2005移植到2013
template <
typename _path_builder,
typename _vertex_allocator
>
struct CBuilderAllocatorConstructor {
template <template <typename _T> class _vertex>
class CDataStorage :
public _path_builder::CDataStorage<_vertex>,
public _vertex_allocator::CDataStorage<typename _path_builder::CDataStorage<_vertex>::CGraphVertex>
{
public:
typedef typename _path_builder::CDataStorage<_vertex> CDataStorageBase;
typedef typename _vertex_allocator::CDataStorage<
typename _path_builder::CDataStorage<
_vertex
>::CGraphVertex
> CDataStorageAllocator;
typedef typename CDataStorageBase::CGraphVertex CGraphVertex;
typedef typename CGraphVertex::_index_type _index_type;
public:
IC CDataStorage (const u32 vertex_count);
virtual ~CDataStorage();
IC void init();
};
};
但在移植VS 2013年後我是得到了錯誤:行 typedef typename _path_builder::CDataStorage<_vertex> CDataStorageBase;
錯誤C2143:語法錯誤:缺少前 '' '<' 是什麼發生?
編輯: 感謝所有的答覆,我都糾正
感謝答覆,我都糾正 – user3167902