mirror of
https://github.com/boostorg/graph.git
synced 2026-02-01 08:32:11 +00:00
changed REQUIRES to function_requires
[SVN r8279]
This commit is contained in:
@@ -106,8 +106,8 @@ The <TT>adjacent_vertices()</TT> function must return in constant time.
|
||||
typedef typename boost::graph_traits<G>::adjacency_iterator
|
||||
adjacency_iterator;
|
||||
void constraints() {
|
||||
REQUIRE(G, IncidenceGraph);
|
||||
REQUIRE(adjacency_iterator, MultiPassInputIterator);
|
||||
function_requires< IncidenceGraph<G> >();
|
||||
function_requires< MultiPassInputIterator<adjacency_iterator> >();
|
||||
|
||||
p = adjacent_vertices(v, g);
|
||||
v = *p.first;
|
||||
|
||||
@@ -139,8 +139,8 @@ undirected graphs).
|
||||
typedef typename boost::graph_traits<G>::in_edge_iterator
|
||||
in_edge_iterator;
|
||||
void constraints() {
|
||||
REQUIRE(G, IncidenceGraph);
|
||||
REQUIRE(in_edge_iterator, MultiPassInputIterator);
|
||||
function_requires< IncidenceGraph<G> >();
|
||||
function_requires< MultiPassInputIterator<in_edge_iterator> >();
|
||||
|
||||
p = in_edges(v, g);
|
||||
e = *p.first;
|
||||
|
||||
@@ -144,8 +144,8 @@ must all return in constant time.
|
||||
typedef typename boost::graph_traits<G>::edge_iterator
|
||||
edge_iterator;
|
||||
void constraints() {
|
||||
REQUIRE(G, Graph);
|
||||
REQUIRE(edge_iterator, MultiPassInputIterator);
|
||||
function_requires< Graph<G> >();
|
||||
function_requires< MultiPassInputIterator<edge_iterator> >();
|
||||
|
||||
p = edges(g);
|
||||
E = num_edges(g);
|
||||
|
||||
@@ -106,12 +106,12 @@ None required.
|
||||
typedef typename boost::graph_traits<G>::edge_parallel_category edge_parallel_category;
|
||||
|
||||
void constraints() {
|
||||
REQUIRE(vertex_descriptor, DefaultConstructible);
|
||||
REQUIRE(vertex_descriptor, EqualityComparable);
|
||||
REQUIRE(vertex_descriptor, Assignable);
|
||||
REQUIRE(edge_descriptor, DefaultConstructible);
|
||||
REQUIRE(edge_descriptor, EqualityComparable);
|
||||
REQUIRE(edge_descriptor, Assignable);
|
||||
function_requires< DefaultConstructible<vertex_descriptor> >();
|
||||
function_requires< EqualityComparable<vertex_descriptor> >();
|
||||
function_requires< Assignable<vertex_descriptor> >();
|
||||
function_requires< DefaultConstructible<edge_descriptor> >();
|
||||
function_requires< EqualityComparable<edge_descriptor> >();
|
||||
function_requires< Assignable<edge_descriptor> >();
|
||||
}
|
||||
G g;
|
||||
};
|
||||
|
||||
@@ -141,8 +141,8 @@ function must be linear in the number of out-edges.
|
||||
{
|
||||
typedef typename boost::graph_traits<G>::out_edge_iterator out_edge_iterator;
|
||||
void constraints() {
|
||||
REQUIRE(G, Graph);
|
||||
REQUIRE(out_edge_iterator, MultiPassInputIterator);
|
||||
function_requires< Graph<G> >();
|
||||
function_requires< MultiPassInputIterator<out_edge_iterator> >();
|
||||
|
||||
p = out_edges(v, g);
|
||||
e = *p.first;
|
||||
|
||||
@@ -129,7 +129,7 @@ Return type: <TT>vertex_descriptor</TT>
|
||||
{
|
||||
typedef typename boost::graph_traits<G>::edge_descriptor edge_descriptor;
|
||||
void constraints() {
|
||||
REQUIRE(G, MutableGraph);
|
||||
function_requires< MutableGraph<G> >();
|
||||
v = add_vertex(g, vp);
|
||||
p = add_edge(g, u, v, ep);
|
||||
}
|
||||
|
||||
@@ -176,9 +176,9 @@ The <tt>get()</tt> property map function must be constant time.
|
||||
typedef typename property_map<G, Property>::type Map;
|
||||
typedef typename property_map<G, Property>::const_type const_Map;
|
||||
void constraints() {
|
||||
REQUIRE(G, Graph);
|
||||
REQUIRE2(Map, X, ReadWritePropertyMap);
|
||||
REQUIRE2(const_Map, X, ReadablePropertyMap);
|
||||
function_requires< Graph<G> >();
|
||||
function_requires< ReadWritePropertyMap<Map, X> >();
|
||||
function_requires< ReadablePropertyMap<const_Map, X> >();
|
||||
|
||||
Map pmap = get(Property(), g);
|
||||
pval = get(Property(), g, x);
|
||||
|
||||
@@ -54,9 +54,10 @@ requirements are added.
|
||||
template <class G>
|
||||
struct VertexAndEdgeListGraph
|
||||
{
|
||||
CLASS_REQUIRES(G, VertexListGraph);
|
||||
CLASS_REQUIRES(G, EdgeListGraph);
|
||||
void constraints() { }
|
||||
void constraints() {
|
||||
function_requires< VertexListGraph<G> >();
|
||||
function_requires< EdgeListGraph<G> >();
|
||||
}
|
||||
};
|
||||
</PRE>
|
||||
|
||||
|
||||
@@ -104,8 +104,8 @@ The <TT>vertices()</TT> function must return in constant time.
|
||||
typedef typename boost::graph_traits<G>::vertex_iterator
|
||||
vertex_iterator;
|
||||
void constraints() {
|
||||
REQUIRE(G, AdjacencyGraph);
|
||||
REQUIRE(vertex_iterator, MultiPassInputIterator);
|
||||
function_requires< AdjacencyGraph<G> >();
|
||||
function_requires< MultiPassInputIterator<vertex_iterator> >();
|
||||
|
||||
p = vertices(g);
|
||||
V = num_vertices(g);
|
||||
|
||||
@@ -82,8 +82,8 @@ most algorithms written to date are). We do restrict the graph type to
|
||||
those types that model <a
|
||||
href="./VertexListGraph.html">VertexListGraph</a>. This is enforced by
|
||||
the use of those graph operations in the algorithm, and furthermore by
|
||||
our explicit requirement added as a concept check with the
|
||||
<TT>REQUIRE</TT> macro (see Section <A
|
||||
our explicit requirement added as a concept check with
|
||||
<TT>function_requires()</TT> (see Section <A
|
||||
HREF="../../concept_checking/concept_checking.html">Concept
|
||||
Checking</A> for more details about concept checking).
|
||||
|
||||
@@ -126,11 +126,11 @@ namespace boost {
|
||||
typedef typename property_traits<Color>::value_type ColorType;
|
||||
typedef typename property_traits<Order>::value_type OrderType;
|
||||
|
||||
REQUIRE(VertexListGraph, VertexListGraph);
|
||||
REQUIRE2(Color, vertex_descriptor, ReadWritePropertyMap);
|
||||
REQUIRE(ColorType, Integer);
|
||||
REQUIRE(Order, size_type, ReadablePropertyMap);
|
||||
REQUIRE_SAME_TYPE(OrderType, vertex_descriptor);
|
||||
function_requires< VertexListGraph<VertexListGraph> >();
|
||||
function_requires< ReadWritePropertyMap<Color, vertex_descriptor> >();
|
||||
function_requires< Integer<ColorType> >();
|
||||
function_requires< size_type, ReadablePropertyMap<Order> >();
|
||||
typedef typename same_type<OrderType, vertex_descriptor>::type req_same;
|
||||
|
||||
size_type max_color = 0;
|
||||
const size_type V = num_vertices(G);
|
||||
|
||||
@@ -240,9 +240,9 @@ href="../test/graph.cpp"><TT>test/graph.cpp</TT></a>.
|
||||
main(int,char*[])
|
||||
{
|
||||
typedef GRAPH<int,int> Graph;
|
||||
REQUIRE(Graph, VertexListGraph);
|
||||
REQUIRE(Graph, BidirectionalGraph);
|
||||
REQUIRE(Graph, MutableGraph);
|
||||
function_requires< VertexListGraph<Graph> >();
|
||||
function_requires< BidirectionalGraph<Graph> >();
|
||||
function_requires< MutableGraph<Graph> >();
|
||||
return 0;
|
||||
}
|
||||
</PRE>
|
||||
|
||||
Reference in New Issue
Block a user