diff --git a/include/nwgraph/adjacency.hpp b/include/nwgraph/adjacency.hpp index 5d9c4c34..38638a00 100644 --- a/include/nwgraph/adjacency.hpp +++ b/include/nwgraph/adjacency.hpp @@ -85,7 +85,7 @@ class index_adjacency : public unipartite_graph_base, public indexed_struct_of_a * @brief Constructor of index_adjacency. Require the type of the graph to be unipartite. * Create an empty index_adjacency. */ - index_adjacency(std::array N, size_t M = 0) requires(std::is_same::value) : unipartite_graph_base(N), base(N[0], M) {} + index_adjacency(std::array N, size_t M = 0) requires(std::is_same::value) : unipartite_graph_base(N[0]), base(N[0], M) {} template index_adjacency(index_edge_list& A, diff --git a/include/nwgraph/edge_list.hpp b/include/nwgraph/edge_list.hpp index e284ebb2..615e9e3d 100644 --- a/include/nwgraph/edge_list.hpp +++ b/include/nwgraph/edge_list.hpp @@ -74,7 +74,7 @@ class index_edge_list : public graph_base_t, public struct_of_arrays; using element = std::tuple; - using reference = base::reference; + using reference = typename base::reference; static const directedness edge_directedness = direct; diff --git a/include/nwgraph/graph_concepts.hpp b/include/nwgraph/graph_concepts.hpp index 1c1669f0..daa656d8 100644 --- a/include/nwgraph/graph_concepts.hpp +++ b/include/nwgraph/graph_concepts.hpp @@ -54,9 +54,10 @@ DECL_TAG_INVOKE(target); * */ template -concept graph = std::copyable && requires(G g) { - typename vertex_id_t; - { num_vertices(g) } -> std::convertible_to>; +concept graph = std::copyable> + && has_vertex_id + && requires(G g) { + { num_vertices(g) } -> std::convertible_to>; }; template diff --git a/include/nwgraph/graph_traits.hpp b/include/nwgraph/graph_traits.hpp index 3c746bd2..949f2676 100644 --- a/include/nwgraph/graph_traits.hpp +++ b/include/nwgraph/graph_traits.hpp @@ -34,7 +34,12 @@ struct graph_traits { }; template -using vertex_id_t = typename graph_traits::vertex_id_type; +using vertex_id_t = typename graph_traits>::vertex_id_type; + +template +concept has_vertex_id = requires { + typename graph_traits>; +}; // template // using vertex_size_t = typename graph_traits::vertex_size_type;