-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Is index_adjacency_list proposed as a concept to be added in namespace std::graph?
There is a couple of aspects to consider.
One. Apart from the syntactic requirements, there are semantic requirements that need to be communicated to the algorithm users. For instance, that for each target vertex v in every list edges(g, u), v should be in range [0, num_vertices(g)).
Two. There are three options to choose from:
- Standardize a concept, such as
std::forward_range. - Define an exposition-only concept that satisfies certain arcane properties of the concept, but doesn't have a standardized name, such as
boolean-testable. - Specify named requirements, which are not a concept, but still specify semantic properties, such as
Cpp17CopyConstructible.
The distinction between standardized and exposition-only concepts is based on whether you want the users tu use the concept in their code, for instance, for constraining their own generic algorithms. The distinction between named requirements and concepts is based on whether you want to build concept hierarchies using the magical properties of the concepts conjunction operator, in order to enable the hierarchies of more and more specialized overloads of the generic algorithms.
Three. Do you want the concepts (or type traits) to appear in algorithm declarations, or is is enough to put them in Mandates or Constraints clauses? Again, the relevant difference here is whether you want to provide hierarchies of more and more specialized overloads of the generic algorithms. If not, the clauses are to be preferred, as per p0788r3.
I would be happy to offer more information on this, and my recommendations.