2
0
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:
Jeremy Siek
2000-11-21 21:36:39 +00:00
parent 69020e939c
commit 35285cc88e
11 changed files with 34 additions and 33 deletions

View File

@@ -106,8 +106,8 @@ The <TT>adjacent_vertices()</TT> function must return in constant time.
typedef typename boost::graph_traits&lt;G&gt;::adjacency_iterator
adjacency_iterator;
void constraints() {
REQUIRE(G, IncidenceGraph);
REQUIRE(adjacency_iterator, MultiPassInputIterator);
function_requires&lt; IncidenceGraph&lt;G&gt; &gt;();
function_requires&lt; MultiPassInputIterator&lt;adjacency_iterator&gt; &gt;();
p = adjacent_vertices(v, g);
v = *p.first;

View File

@@ -139,8 +139,8 @@ undirected graphs).
typedef typename boost::graph_traits&lt;G&gt;::in_edge_iterator
in_edge_iterator;
void constraints() {
REQUIRE(G, IncidenceGraph);
REQUIRE(in_edge_iterator, MultiPassInputIterator);
function_requires&lt; IncidenceGraph&lt;G&gt; &gt;();
function_requires&lt; MultiPassInputIterator&lt;in_edge_iterator&gt; &gt;();
p = in_edges(v, g);
e = *p.first;

View File

@@ -144,8 +144,8 @@ must all return in constant time.
typedef typename boost::graph_traits&lt;G&gt;::edge_iterator
edge_iterator;
void constraints() {
REQUIRE(G, Graph);
REQUIRE(edge_iterator, MultiPassInputIterator);
function_requires&lt; Graph&lt;G&gt; &gt;();
function_requires&lt; MultiPassInputIterator&lt;edge_iterator&gt; &gt;();
p = edges(g);
E = num_edges(g);

View File

@@ -106,12 +106,12 @@ None required.
typedef typename boost::graph_traits&lt;G&gt;::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&lt; DefaultConstructible&lt;vertex_descriptor&gt; &gt;();
function_requires&lt; EqualityComparable&lt;vertex_descriptor&gt; &gt;();
function_requires&lt; Assignable&lt;vertex_descriptor&gt; &gt;();
function_requires&lt; DefaultConstructible&lt;edge_descriptor&gt; &gt;();
function_requires&lt; EqualityComparable&lt;edge_descriptor&gt; &gt;();
function_requires&lt; Assignable&lt;edge_descriptor&gt; &gt;();
}
G g;
};

View File

@@ -141,8 +141,8 @@ function must be linear in the number of out-edges.
{
typedef typename boost::graph_traits&lt;G&gt;::out_edge_iterator out_edge_iterator;
void constraints() {
REQUIRE(G, Graph);
REQUIRE(out_edge_iterator, MultiPassInputIterator);
function_requires&lt; Graph&lt;G&gt; &gt;();
function_requires&lt; MultiPassInputIterator&lt;out_edge_iterator&gt; &gt;();
p = out_edges(v, g);
e = *p.first;

View File

@@ -129,7 +129,7 @@ Return type: <TT>vertex_descriptor</TT>
{
typedef typename boost::graph_traits&lt;G&gt;::edge_descriptor edge_descriptor;
void constraints() {
REQUIRE(G, MutableGraph);
function_requires&lt; MutableGraph&lt;G&gt; &gt;();
v = add_vertex(g, vp);
p = add_edge(g, u, v, ep);
}

View File

@@ -176,9 +176,9 @@ The <tt>get()</tt> property map function must be constant time.
typedef typename property_map&lt;G, Property&gt;::type Map;
typedef typename property_map&lt;G, Property&gt;::const_type const_Map;
void constraints() {
REQUIRE(G, Graph);
REQUIRE2(Map, X, ReadWritePropertyMap);
REQUIRE2(const_Map, X, ReadablePropertyMap);
function_requires&lt; Graph&lt;G&gt; &gt;();
function_requires&lt; ReadWritePropertyMap&lt;Map, X&gt; &gt;();
function_requires&lt; ReadablePropertyMap&lt;const_Map, X&gt; &gt;();
Map pmap = get(Property(), g);
pval = get(Property(), g, x);

View File

@@ -54,9 +54,10 @@ requirements are added.
template &lt;class G&gt;
struct VertexAndEdgeListGraph
{
CLASS_REQUIRES(G, VertexListGraph);
CLASS_REQUIRES(G, EdgeListGraph);
void constraints() { }
void constraints() {
function_requires&lt; VertexListGraph&lt;G&gt; &gt;();
function_requires&lt; EdgeListGraph&lt;G&gt; &gt;();
}
};
</PRE>

View File

@@ -104,8 +104,8 @@ The <TT>vertices()</TT> function must return in constant time.
typedef typename boost::graph_traits&lt;G&gt;::vertex_iterator
vertex_iterator;
void constraints() {
REQUIRE(G, AdjacencyGraph);
REQUIRE(vertex_iterator, MultiPassInputIterator);
function_requires&lt; AdjacencyGraph&lt;G&gt; &gt;();
function_requires&lt; MultiPassInputIterator&lt;vertex_iterator&gt; &gt;();
p = vertices(g);
V = num_vertices(g);

View File

@@ -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&lt;Color&gt;::value_type ColorType;
typedef typename property_traits&lt;Order&gt;::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&lt; VertexListGraph&lt;VertexListGraph&gt; &gt;();
function_requires&lt; ReadWritePropertyMap&lt;Color, vertex_descriptor&gt; &gt;();
function_requires&lt; Integer&lt;ColorType&gt; &gt;();
function_requires&lt; size_type, ReadablePropertyMap&lt;Order&gt; &gt;();
typedef typename same_type&lt;OrderType, vertex_descriptor&gt;::type req_same;
size_type max_color = 0;
const size_type V = num_vertices(G);

View File

@@ -240,9 +240,9 @@ href="../test/graph.cpp"><TT>test/graph.cpp</TT></a>.
main(int,char*[])
{
typedef GRAPH&lt;int,int&gt; Graph;
REQUIRE(Graph, VertexListGraph);
REQUIRE(Graph, BidirectionalGraph);
REQUIRE(Graph, MutableGraph);
function_requires&lt; VertexListGraph&lt;Graph&gt; &gt;();
function_requires&lt; BidirectionalGraph&lt;Graph&gt; &gt;();
function_requires&lt; MutableGraph&lt;Graph&gt; &gt;();
return 0;
}
</PRE>