Снова MSVC против g++ :
template <typename TIndex>
struct CVertexManagerFixed
{
template <typename TPathBuilder, typename TCompoundVertex>
class CDataStorage : public TPathBuilder::template CDataStorage<TCompoundVertex>
{
public:
using CDataStorageBase = typename TPathBuilder::template CDataStorage<TCompoundVertex>;
using Vertex = TCompoundVertex;
using Index = TIndex;
public:
inline CDataStorage(const u32 vertex_count);
inline virtual ~CDataStorage();
inline Vertex& get_node(const Index& vertex_id) const;
};
};
#define TEMPLATE_SPECIALIZATION \
template <typename TIndex> \
template <typename TPathBuilder, typename TCompoundVertex>
#define CFixedVertexManager \
CVertexManagerFixed<TIndex>::CDataStorage<TPathBuilder, TCompoundVertex>
TEMPLATE_SPECIALIZATION
inline CFixedVertexManager::CDataStorage(const u32 vertex_count)
: CDataStorageBase(vertex_count)
{
}
TEMPLATE_SPECIALIZATION
inline typename CFixedVertexManager::Vertex& CFixedVertexManager::get_node(const Index& vertex_id) const
{
VERIFY(vertex_id < m_max_node_count);
VERIFY(is_visited(vertex_id));
return *m_indexes[vertex_id].m_vertex;
}
Лог ошибок:
../src/test_cpp.cpp:54:34: error: non-template ‘CDataStorage’ used as template
CVertexManagerFixed<TIndex>::CDataStorage<TPathBuilder, TCompoundVertex>
^
../src/test_cpp.cpp:63:17: note: in expansion of macro ‘CFixedVertexManager’
inline typename CFixedVertexManager::Vertex& CFixedVertexManager::get_node(const Index& vertex_id) const
^
../src/test_cpp.cpp:54:34: note: use ‘CVertexManagerFixed<TIndex>::template CDataStorage’ to indicate that it is a template
CVertexManagerFixed<TIndex>::CDataStorage<TPathBuilder, TCompoundVertex>
^
../src/test_cpp.cpp:63:17: note: in expansion of macro ‘CFixedVertexManager’
inline typename CFixedVertexManager::Vertex& CFixedVertexManager::get_node(const Index& vertex_id) const
^
../src/test_cpp.cpp:54:59: error: expected unqualified-id before ‘,’ token
CVertexManagerFixed<TIndex>::CDataStorage<TPathBuilder, TCompoundVertex>
^
../src/test_cpp.cpp:63:46: note: in expansion of macro ‘CFixedVertexManager’
inline typename CFixedVertexManager::Vertex& CFixedVertexManager::get_node(const Index& vertex_id) const