dimanche 1 juillet 2018

Recursive alias template (C++11)

I'm creating an adjacency list to modelize an oriented weighted graph, and i'd like to know if recursive alias templates are possibe. I've tried something like this

template<class edge_data>
using graph_test = std::set<std::map<std::set<graph_test>::const_pointer, edge_data>>;

(each entry of the set is a map, and each map represents a vertex. each entry of the maps are edges: keys are pointers to other vertices, values are weight. the pointers are not invalidated on insertion)

This produces an error : 'graph_test': undeclared identifier.

I know I could use std::any to avoid this problem, but it look a bit 'dangerous', even if I know what I'm doing.

Do yu have any suggestions/ideas that might solve this problem ?

Aucun commentaire:

Enregistrer un commentaire