Ticket #615: 0f291d5010f6.patch
File 0f291d5010f6.patch, 34.6 KB (added by , 6 years ago) |
---|
-
demo/graph_to_eps_demo.cc
# HG changeset patch # User Alpar Juttner <alpar@cs.elte.hu> # Date 1540551630 -7200 # Fri Oct 26 13:00:30 2018 +0200 # Node ID 0f291d5010f6a47d3038a9f0ee0f6bfb820fbd97 # Parent 3c00344f49c951d5076dd2c4b7a2389603aba66c Kill unused typef warnings (#615) diff --git a/demo/graph_to_eps_demo.cc b/demo/graph_to_eps_demo.cc
a b 46 46 ListDigraph g; 47 47 typedef ListDigraph::Node Node; 48 48 typedef ListDigraph::NodeIt NodeIt; 49 ignore_unused_warning<NodeIt>(); 49 50 typedef ListDigraph::Arc Arc; 50 51 typedef dim2::Point<int> Point; 51 52 -
lemon/concept_check.h
diff --git a/lemon/concept_check.h b/lemon/concept_check.h
a b 26 26 #ifndef LEMON_CONCEPT_CHECK_H 27 27 #define LEMON_CONCEPT_CHECK_H 28 28 29 namespace lemon { 30 31 /* 32 "inline" is used for ignore_unused_variable_warning() 33 and function_requires() to make sure there is no 34 overtarget with g++. 35 */ 29 #include<lemon/core.h> 36 30 37 template <class T> inline void ignore_unused_variable_warning(const T&) { } 38 template <class T1, class T2> 39 inline void ignore_unused_variable_warning(const T1&, const T2&) { } 40 template <class T1, class T2, class T3> 41 inline void ignore_unused_variable_warning(const T1&, const T2&, 42 const T3&) { } 43 template <class T1, class T2, class T3, class T4> 44 inline void ignore_unused_variable_warning(const T1&, const T2&, 45 const T3&, const T4&) { } 46 template <class T1, class T2, class T3, class T4, class T5> 47 inline void ignore_unused_variable_warning(const T1&, const T2&, 48 const T3&, const T4&, 49 const T5&) { } 50 template <class T1, class T2, class T3, class T4, class T5, class T6> 51 inline void ignore_unused_variable_warning(const T1&, const T2&, 52 const T3&, const T4&, 53 const T5&, const T6&) { } 31 namespace lemon { 54 32 55 33 ///\e 56 34 template <class Concept> -
lemon/connectivity.h
diff --git a/lemon/connectivity.h b/lemon/connectivity.h
a b 266 266 checkConcept<concepts::Digraph, Digraph>(); 267 267 268 268 typedef typename Digraph::Node Node; 269 ignore_unused_warning<Node>(); 269 270 typedef typename Digraph::NodeIt NodeIt; 270 271 271 272 typename Digraph::Node source = NodeIt(digraph); … … 334 335 335 336 typedef typename Digraph::Node Node; 336 337 typedef typename Digraph::Arc Arc; 338 ignore_unused_warning<Arc>(); 337 339 typedef typename Digraph::NodeIt NodeIt; 338 340 typedef typename Digraph::ArcIt ArcIt; 341 ignore_unused_warning<ArcIt>(); 339 342 340 343 typedef std::vector<Node> Container; 341 344 typedef typename Container::iterator Iterator; … … 1344 1347 checkConcept<concepts::WriteMap<typename Digraph::Node, int>, NodeMap>(); 1345 1348 1346 1349 typedef typename Digraph::Node Node; 1350 ignore_unused_warning<Node>(); 1347 1351 typedef typename Digraph::NodeIt NodeIt; 1348 1352 typedef typename Digraph::Arc Arc; 1353 ignore_unused_warning<Arc>(); 1349 1354 1350 1355 TopologicalSortVisitor<Digraph, NodeMap> 1351 1356 visitor(order, countNodes(digraph)); … … 1559 1564 1560 1565 typedef typename Graph::NodeIt NodeIt; 1561 1566 typedef typename Graph::ArcIt ArcIt; 1567 ignore_unused_warning<ArcIt>(); 1562 1568 1563 1569 bool bipartite = true; 1564 1570 … … 1604 1610 checkConcept<concepts::WriteMap<typename Graph::Node, bool>, NodeMap>(); 1605 1611 1606 1612 typedef typename Graph::Node Node; 1613 ignore_unused_warning<Node>(); 1607 1614 typedef typename Graph::NodeIt NodeIt; 1608 1615 typedef typename Graph::ArcIt ArcIt; 1616 ignore_unused_warning<ArcIt>(); 1609 1617 1610 1618 bool bipartite = true; 1611 1619 -
lemon/core.h
diff --git a/lemon/core.h b/lemon/core.h
a b 54 54 55 55 namespace lemon { 56 56 57 58 // The contents of the ignore* stuff below was inspired by the 59 // concept checking utility of the BOOST library 60 // (http://www.boost.org). 61 62 63 /* 64 "inline" is used for ignore_unused_variable_warning() 65 and function_requires() to make sure there is no 66 overtarget with g++. 67 */ 68 69 template <class T> inline void ignore_unused_variable_warning(const T&) { } 70 template <class T1, class T2> 71 inline void ignore_unused_variable_warning(const T1&, const T2&) { } 72 template <class T1, class T2, class T3> 73 inline void ignore_unused_variable_warning(const T1&, const T2&, 74 const T3&) { } 75 template <class T1, class T2, class T3, class T4> 76 inline void ignore_unused_variable_warning(const T1&, const T2&, 77 const T3&, const T4&) { } 78 template <class T1, class T2, class T3, class T4, class T5> 79 inline void ignore_unused_variable_warning(const T1&, const T2&, 80 const T3&, const T4&, 81 const T5&) { } 82 template <class T1, class T2, class T3, class T4, class T5, class T6> 83 inline void ignore_unused_variable_warning(const T1&, const T2&, 84 const T3&, const T4&, 85 const T5&, const T6&) { } 86 87 template <typename T> inline void ignore_unused_warning() { } 88 57 89 /// \brief Dummy type to make it easier to create invalid iterators. 58 90 /// 59 91 /// Dummy type to make it easier to create invalid iterators. … … 102 134 typedef Digraph::ArcMap<int> IntArcMap; \ 103 135 typedef Digraph::ArcMap<double> DoubleArcMap 104 136 137 #define DIGRAPH_TYPEDEFS_NOWARN(Digraph) \ 138 DIGRAPH_TYPEDEFS(Digraph); \ 139 ignore_unused_warning<Node>(); \ 140 ignore_unused_warning<NodeIt>(); \ 141 ignore_unused_warning<Arc>(); \ 142 ignore_unused_warning<ArcIt>(); \ 143 ignore_unused_warning<InArcIt>(); \ 144 ignore_unused_warning<OutArcIt>(); \ 145 ignore_unused_warning<BoolNodeMap>(); \ 146 ignore_unused_warning<IntNodeMap>(); \ 147 ignore_unused_warning<DoubleNodeMap>(); \ 148 ignore_unused_warning<BoolArcMap>(); \ 149 ignore_unused_warning<IntArcMap>(); \ 150 ignore_unused_warning<DoubleArcMap>() 105 151 ///Create convenience typedefs for the digraph types and iterators 106 152 107 153 ///\see DIGRAPH_TYPEDEFS … … 122 168 typedef typename Digraph::template ArcMap<int> IntArcMap; \ 123 169 typedef typename Digraph::template ArcMap<double> DoubleArcMap 124 170 171 #define TEMPLATE_DIGRAPH_TYPEDEFS_NOWARN(Digraph) \ 172 TEMPLATE_DIGRAPH_TYPEDEFS(Digraph); \ 173 ignore_unused_warning<Node>(); \ 174 ignore_unused_warning<NodeIt>(); \ 175 ignore_unused_warning<Arc>(); \ 176 ignore_unused_warning<ArcIt>(); \ 177 ignore_unused_warning<InArcIt>(); \ 178 ignore_unused_warning<OutArcIt>(); \ 179 ignore_unused_warning<BoolNodeMap>(); \ 180 ignore_unused_warning<IntNodeMap>(); \ 181 ignore_unused_warning<DoubleNodeMap>(); \ 182 ignore_unused_warning<BoolArcMap>(); \ 183 ignore_unused_warning<IntArcMap>(); \ 184 ignore_unused_warning<DoubleArcMap>() 185 125 186 ///Create convenience typedefs for the graph types and iterators 126 187 127 188 ///This \c \#define creates the same convenient type definitions as defined … … 141 202 typedef Graph::EdgeMap<int> IntEdgeMap; \ 142 203 typedef Graph::EdgeMap<double> DoubleEdgeMap 143 204 205 #define GRAPH_TYPEDEFS_NOWARN(Graph) \ 206 GRAPH_TYPEDEFS(Graph); \ 207 ignore_unused_warning<Node>(); \ 208 ignore_unused_warning<NodeIt>(); \ 209 ignore_unused_warning<Arc>(); \ 210 ignore_unused_warning<ArcIt>(); \ 211 ignore_unused_warning<InArcIt>(); \ 212 ignore_unused_warning<OutArcIt>(); \ 213 ignore_unused_warning<BoolNodeMap>(); \ 214 ignore_unused_warning<IntNodeMap>(); \ 215 ignore_unused_warning<DoubleNodeMap>(); \ 216 ignore_unused_warning<BoolArcMap>(); \ 217 ignore_unused_warning<IntArcMap>(); \ 218 ignore_unused_warning<DoubleArcMap>(); \ 219 ignore_unused_warning<Edge>(); \ 220 ignore_unused_warning<EdgeIt>(); \ 221 ignore_unused_warning<IncEdgeIt>(); \ 222 ignore_unused_warning<BoolEdgeMap>(); \ 223 ignore_unused_warning<IntEdgeMap>(); \ 224 ignore_unused_warning<DoubleEdgeMap>() \ 225 226 144 227 ///Create convenience typedefs for the graph types and iterators 145 228 146 229 ///\see GRAPH_TYPEDEFS … … 156 239 typedef typename Graph::template EdgeMap<int> IntEdgeMap; \ 157 240 typedef typename Graph::template EdgeMap<double> DoubleEdgeMap 158 241 242 #define TEMPLATE_GRAPH_TYPEDEFS_NOWARN(Graph) \ 243 TEMPLATE_GRAPH_TYPEDEFS(Graph); \ 244 ignore_unused_warning<Node>(); \ 245 ignore_unused_warning<NodeIt>(); \ 246 ignore_unused_warning<Arc>(); \ 247 ignore_unused_warning<ArcIt>(); \ 248 ignore_unused_warning<InArcIt>(); \ 249 ignore_unused_warning<OutArcIt>(); \ 250 ignore_unused_warning<BoolNodeMap>(); \ 251 ignore_unused_warning<IntNodeMap>(); \ 252 ignore_unused_warning<DoubleNodeMap>(); \ 253 ignore_unused_warning<BoolArcMap>(); \ 254 ignore_unused_warning<IntArcMap>(); \ 255 ignore_unused_warning<DoubleArcMap>(); \ 256 ignore_unused_warning<Edge>(); \ 257 ignore_unused_warning<EdgeIt>(); \ 258 ignore_unused_warning<IncEdgeIt>(); \ 259 ignore_unused_warning<BoolEdgeMap>(); \ 260 ignore_unused_warning<IntEdgeMap>(); \ 261 ignore_unused_warning<DoubleEdgeMap>() \ 262 159 263 ///Create convenience typedefs for the bipartite graph types and iterators 160 264 161 265 ///This \c \#define creates the same convenient type definitions as … … 180 284 typedef BpGraph::BlueNodeMap<int> IntBlueNodeMap; \ 181 285 typedef BpGraph::BlueNodeMap<double> DoubleBlueNodeMap 182 286 287 #define BPGRAPH_TYPEDEFS_NOWARN(BpGraph) \ 288 BPGRAPH_TYPEDEFS(BpGraph); \ 289 ignore_unused_warning<Node>(); \ 290 ignore_unused_warning<NodeIt>(); \ 291 ignore_unused_warning<Arc>(); \ 292 ignore_unused_warning<ArcIt>(); \ 293 ignore_unused_warning<InArcIt>(); \ 294 ignore_unused_warning<OutArcIt>(); \ 295 ignore_unused_warning<BoolNodeMap>(); \ 296 ignore_unused_warning<IntNodeMap>(); \ 297 ignore_unused_warning<DoubleNodeMap>(); \ 298 ignore_unused_warning<BoolArcMap>(); \ 299 ignore_unused_warning<IntArcMap>(); \ 300 ignore_unused_warning<DoubleArcMap>(); \ 301 ignore_unused_warning<Edge>(); \ 302 ignore_unused_warning<EdgeIt>(); \ 303 ignore_unused_warning<IncEdgeIt>(); \ 304 ignore_unused_warning<BoolEdgeMap>(); \ 305 ignore_unused_warning<IntEdgeMap>(); \ 306 ignore_unused_warning<DoubleEdgeMap>(); \ 307 ignore_unused_warning<RedNode>(); \ 308 ignore_unused_warning<RedNodeIt>(); \ 309 ignore_unused_warning<BoolRedNodeMap>(); \ 310 ignore_unused_warning<IntRedNodeMap>(); \ 311 ignore_unused_warning<DoubleRedNodeMap>(); \ 312 ignore_unused_warning<BlueNode>(); \ 313 ignore_unused_warning<BlueNodeIt>(); \ 314 ignore_unused_warning<BoolBlueNodeMap>(); \ 315 ignore_unused_warning<IntBlueNodeMap>(); \ 316 ignore_unused_warning<DoubleBlueNodeMap>() \ 317 183 318 ///Create convenience typedefs for the bipartite graph types and iterators 184 319 185 320 ///\see BPGRAPH_TYPEDEFS … … 199 334 typedef typename BpGraph::template BlueNodeMap<int> IntBlueNodeMap; \ 200 335 typedef typename BpGraph::template BlueNodeMap<double> DoubleBlueNodeMap 201 336 337 338 #define TEMPLATE_BPGRAPH_TYPEDEFS_NOWARN(BpGraph) \ 339 TEMPLATE_BPGRAPH_TYPEDEFS(BpGraph); \ 340 ignore_unused_warning<Node>(); \ 341 ignore_unused_warning<NodeIt>(); \ 342 ignore_unused_warning<Arc>(); \ 343 ignore_unused_warning<ArcIt>(); \ 344 ignore_unused_warning<InArcIt>(); \ 345 ignore_unused_warning<OutArcIt>(); \ 346 ignore_unused_warning<BoolNodeMap>(); \ 347 ignore_unused_warning<IntNodeMap>(); \ 348 ignore_unused_warning<DoubleNodeMap>(); \ 349 ignore_unused_warning<BoolArcMap>(); \ 350 ignore_unused_warning<IntArcMap>(); \ 351 ignore_unused_warning<DoubleArcMap>(); \ 352 ignore_unused_warning<Edge>(); \ 353 ignore_unused_warning<EdgeIt>(); \ 354 ignore_unused_warning<IncEdgeIt>(); \ 355 ignore_unused_warning<BoolEdgeMap>(); \ 356 ignore_unused_warning<IntEdgeMap>(); \ 357 ignore_unused_warning<DoubleEdgeMap>(); \ 358 ignore_unused_warning<RedNode>(); \ 359 ignore_unused_warning<RedNodeIt>(); \ 360 ignore_unused_warning<BoolRedNodeMap>(); \ 361 ignore_unused_warning<IntRedNodeMap>(); \ 362 ignore_unused_warning<DoubleRedNodeMap>(); \ 363 ignore_unused_warning<BlueNode>(); \ 364 ignore_unused_warning<BlueNodeIt>(); \ 365 ignore_unused_warning<BoolBlueNodeMap>(); \ 366 ignore_unused_warning<IntBlueNodeMap>(); \ 367 ignore_unused_warning<DoubleBlueNodeMap>() \ 368 202 369 /// \brief Function to count the items in a graph. 203 370 /// 204 371 /// This function counts the items (nodes, arcs etc.) in a graph. -
lemon/kruskal.h
diff --git a/lemon/kruskal.h b/lemon/kruskal.h
a b 44 44 typedef typename In::value_type::second_type Value; 45 45 typedef typename Digraph::template NodeMap<int> IndexMap; 46 46 typedef typename Digraph::Node Node; 47 ignore_unused_warning<Node>(); 48 47 49 48 50 IndexMap index(digraph); 49 51 UnionFind<IndexMap> uf(index); … … 73 75 typedef typename In::value_type::second_type Value; 74 76 typedef typename Graph::template NodeMap<int> IndexMap; 75 77 typedef typename Graph::Node Node; 78 ignore_unused_warning<Node>(); 76 79 77 80 IndexMap index(graph); 78 81 UnionFind<IndexMap> uf(index); -
lemon/planarity.h
diff --git a/lemon/planarity.h b/lemon/planarity.h
a b 2100 2100 void drawing(const AuxGraph& graph, 2101 2101 const AuxEmbeddingMap& next, 2102 2102 PointMap& point_map) { 2103 TEMPLATE_GRAPH_TYPEDEFS (AuxGraph);2103 TEMPLATE_GRAPH_TYPEDEFS_NOWARN(AuxGraph); 2104 2104 2105 2105 typename AuxGraph::template ArcMap<Arc> prev(graph); 2106 2106 -
lemon/static_graph.h
diff --git a/lemon/static_graph.h b/lemon/static_graph.h
a b 145 145 template <typename Digraph, typename NodeRefMap, typename ArcRefMap> 146 146 void build(const Digraph& digraph, NodeRefMap& nodeRef, ArcRefMap& arcRef) { 147 147 typedef typename Digraph::Node GNode; 148 ignore_unused_warning<GNode>(); 148 149 typedef typename Digraph::Arc GArc; 149 150 150 151 built = true; -
test/bellman_ford_test.cc
diff --git a/test/bellman_ford_test.cc b/test/bellman_ford_test.cc
a b 168 168 169 169 template <typename Digraph, typename Value> 170 170 void checkBellmanFord() { 171 TEMPLATE_DIGRAPH_TYPEDEFS (Digraph);171 TEMPLATE_DIGRAPH_TYPEDEFS_NOWARN(Digraph); 172 172 typedef typename Digraph::template ArcMap<Value> LengthMap; 173 173 174 174 Digraph gr; … … 227 227 } 228 228 229 229 void checkBellmanFordNegativeCycle() { 230 DIGRAPH_TYPEDEFS (SmartDigraph);230 DIGRAPH_TYPEDEFS_NOWARN(SmartDigraph); 231 231 232 232 SmartDigraph gr; 233 233 IntArcMap length(gr); -
test/bfs_test.cc
diff --git a/test/bfs_test.cc b/test/bfs_test.cc
a b 180 180 181 181 template <class Digraph> 182 182 void checkBfs() { 183 TEMPLATE_DIGRAPH_TYPEDEFS (Digraph);183 TEMPLATE_DIGRAPH_TYPEDEFS_NOWARN(Digraph); 184 184 185 185 Digraph G; 186 186 Node s, t; -
test/bpgraph_test.cc
diff --git a/test/bpgraph_test.cc b/test/bpgraph_test.cc
a b 29 29 30 30 template <class BpGraph> 31 31 void checkBpGraphBuild() { 32 TEMPLATE_BPGRAPH_TYPEDEFS (BpGraph);32 TEMPLATE_BPGRAPH_TYPEDEFS_NOWARN(BpGraph); 33 33 34 34 BpGraph G; 35 35 checkGraphNodeList(G, 0); … … 110 110 111 111 template <class BpGraph> 112 112 void checkBpGraphErase() { 113 TEMPLATE_BPGRAPH_TYPEDEFS (BpGraph);113 TEMPLATE_BPGRAPH_TYPEDEFS_NOWARN(BpGraph); 114 114 115 115 BpGraph G; 116 116 RedNode … … 159 159 160 160 template <class BpGraph> 161 161 void checkBpGraphAlter() { 162 TEMPLATE_BPGRAPH_TYPEDEFS (BpGraph);162 TEMPLATE_BPGRAPH_TYPEDEFS_NOWARN(BpGraph); 163 163 164 164 BpGraph G; 165 165 RedNode … … 211 211 212 212 template <class BpGraph> 213 213 void checkBpGraphSnapshot() { 214 TEMPLATE_BPGRAPH_TYPEDEFS (BpGraph);214 TEMPLATE_BPGRAPH_TYPEDEFS_NOWARN(BpGraph); 215 215 216 216 BpGraph G; 217 217 RedNode … … 296 296 297 297 template <typename BpGraph> 298 298 void checkBpGraphValidity() { 299 TEMPLATE_BPGRAPH_TYPEDEFS (BpGraph);299 TEMPLATE_BPGRAPH_TYPEDEFS_NOWARN(BpGraph); 300 300 BpGraph g; 301 301 302 302 RedNode … … 358 358 359 359 void checkFullBpGraph(int redNum, int blueNum) { 360 360 typedef FullBpGraph BpGraph; 361 BPGRAPH_TYPEDEFS (BpGraph);361 BPGRAPH_TYPEDEFS_NOWARN(BpGraph); 362 362 363 363 BpGraph G(redNum, blueNum); 364 364 checkGraphNodeList(G, redNum + blueNum); -
test/circulation_test.cc
diff --git a/test/circulation_test.cc b/test/circulation_test.cc
a b 126 126 int main (int, char*[]) 127 127 { 128 128 typedef ListDigraph Digraph; 129 DIGRAPH_TYPEDEFS (Digraph);129 DIGRAPH_TYPEDEFS_NOWARN(Digraph); 130 130 131 131 Digraph g; 132 132 IntArcMap lo(g), up(g); -
test/dfs_test.cc
diff --git a/test/dfs_test.cc b/test/dfs_test.cc
a b 182 182 183 183 template <class Digraph> 184 184 void checkDfs() { 185 TEMPLATE_DIGRAPH_TYPEDEFS (Digraph);185 TEMPLATE_DIGRAPH_TYPEDEFS_NOWARN(Digraph); 186 186 187 187 Digraph G; 188 188 Node s, t; -
test/digraph_test.cc
diff --git a/test/digraph_test.cc b/test/digraph_test.cc
a b 30 30 31 31 template <class Digraph> 32 32 void checkDigraphBuild() { 33 TEMPLATE_DIGRAPH_TYPEDEFS (Digraph);33 TEMPLATE_DIGRAPH_TYPEDEFS_NOWARN(Digraph); 34 34 Digraph G; 35 35 36 36 checkGraphNodeList(G, 0); … … 87 87 88 88 template <class Digraph> 89 89 void checkDigraphSplit() { 90 TEMPLATE_DIGRAPH_TYPEDEFS (Digraph);90 TEMPLATE_DIGRAPH_TYPEDEFS_NOWARN(Digraph); 91 91 92 92 Digraph G; 93 93 Node n1 = G.addNode(), n2 = G.addNode(), n3 = G.addNode(); … … 119 119 120 120 template <class Digraph> 121 121 void checkDigraphAlter() { 122 TEMPLATE_DIGRAPH_TYPEDEFS (Digraph);122 TEMPLATE_DIGRAPH_TYPEDEFS_NOWARN(Digraph); 123 123 124 124 Digraph G; 125 125 Node n1 = G.addNode(), n2 = G.addNode(), … … 199 199 200 200 template <class Digraph> 201 201 void checkDigraphErase() { 202 TEMPLATE_DIGRAPH_TYPEDEFS (Digraph);202 TEMPLATE_DIGRAPH_TYPEDEFS_NOWARN(Digraph); 203 203 204 204 Digraph G; 205 205 Node n1 = G.addNode(), n2 = G.addNode(), … … 249 249 250 250 template <class Digraph> 251 251 void checkDigraphSnapshot() { 252 TEMPLATE_DIGRAPH_TYPEDEFS (Digraph);252 TEMPLATE_DIGRAPH_TYPEDEFS_NOWARN(Digraph); 253 253 254 254 Digraph G; 255 255 Node n1 = G.addNode(), n2 = G.addNode(), n3 = G.addNode(); … … 345 345 346 346 template <typename Digraph> 347 347 void checkDigraphValidity() { 348 TEMPLATE_DIGRAPH_TYPEDEFS (Digraph);348 TEMPLATE_DIGRAPH_TYPEDEFS_NOWARN(Digraph); 349 349 Digraph g; 350 350 351 351 Node … … 367 367 368 368 template <typename Digraph> 369 369 void checkDigraphValidityErase() { 370 TEMPLATE_DIGRAPH_TYPEDEFS (Digraph);370 TEMPLATE_DIGRAPH_TYPEDEFS_NOWARN(Digraph); 371 371 Digraph g; 372 372 373 373 Node … … 504 504 505 505 void checkFullDigraph(int num) { 506 506 typedef FullDigraph Digraph; 507 DIGRAPH_TYPEDEFS (Digraph);507 DIGRAPH_TYPEDEFS_NOWARN(Digraph); 508 508 509 509 Digraph G(num); 510 510 check(G.nodeNum() == num && G.arcNum() == num * num, "Wrong size"); -
test/dijkstra_test.cc
diff --git a/test/dijkstra_test.cc b/test/dijkstra_test.cc
a b 184 184 185 185 template <class Digraph> 186 186 void checkDijkstra() { 187 TEMPLATE_DIGRAPH_TYPEDEFS (Digraph);187 TEMPLATE_DIGRAPH_TYPEDEFS_NOWARN(Digraph); 188 188 typedef typename Digraph::template ArcMap<int> LengthMap; 189 189 190 190 Digraph G; -
test/graph_test.cc
diff --git a/test/graph_test.cc b/test/graph_test.cc
a b 31 31 32 32 template <class Graph> 33 33 void checkGraphBuild() { 34 TEMPLATE_GRAPH_TYPEDEFS (Graph);34 TEMPLATE_GRAPH_TYPEDEFS_NOWARN(Graph); 35 35 36 36 Graph G; 37 37 checkGraphNodeList(G, 0); … … 91 91 92 92 template <class Graph> 93 93 void checkGraphAlter() { 94 TEMPLATE_GRAPH_TYPEDEFS (Graph);94 TEMPLATE_GRAPH_TYPEDEFS_NOWARN(Graph); 95 95 96 96 Graph G; 97 97 Node n1 = G.addNode(), n2 = G.addNode(), … … 171 171 172 172 template <class Graph> 173 173 void checkGraphErase() { 174 TEMPLATE_GRAPH_TYPEDEFS (Graph);174 TEMPLATE_GRAPH_TYPEDEFS_NOWARN(Graph); 175 175 176 176 Graph G; 177 177 Node n1 = G.addNode(), n2 = G.addNode(), … … 214 214 215 215 template <class Graph> 216 216 void checkGraphSnapshot() { 217 TEMPLATE_GRAPH_TYPEDEFS (Graph);217 TEMPLATE_GRAPH_TYPEDEFS_NOWARN(Graph); 218 218 219 219 Graph G; 220 220 Node n1 = G.addNode(), n2 = G.addNode(), n3 = G.addNode(); … … 280 280 281 281 void checkFullGraph(int num) { 282 282 typedef FullGraph Graph; 283 GRAPH_TYPEDEFS (Graph);283 GRAPH_TYPEDEFS_NOWARN(Graph); 284 284 285 285 Graph G(num); 286 286 check(G.nodeNum() == num && G.edgeNum() == num * (num - 1) / 2, … … 374 374 375 375 template <typename Graph> 376 376 void checkGraphValidity() { 377 TEMPLATE_GRAPH_TYPEDEFS (Graph);377 TEMPLATE_GRAPH_TYPEDEFS_NOWARN(Graph); 378 378 Graph g; 379 379 380 380 Node … … 398 398 399 399 template <typename Graph> 400 400 void checkGraphValidityErase() { 401 TEMPLATE_GRAPH_TYPEDEFS (Graph);401 TEMPLATE_GRAPH_TYPEDEFS_NOWARN(Graph); 402 402 Graph g; 403 403 404 404 Node … … 429 429 430 430 void checkGridGraph(int width, int height) { 431 431 typedef GridGraph Graph; 432 GRAPH_TYPEDEFS (Graph);432 GRAPH_TYPEDEFS_NOWARN(Graph); 433 433 Graph G(width, height); 434 434 435 435 check(G.width() == width, "Wrong column number"); … … 511 511 } 512 512 513 513 void checkHypercubeGraph(int dim) { 514 GRAPH_TYPEDEFS (HypercubeGraph);514 GRAPH_TYPEDEFS_NOWARN(HypercubeGraph); 515 515 516 516 HypercubeGraph G(dim); 517 517 check(G.dimension() == dim, "Wrong dimension"); -
test/graph_test.h
diff --git a/test/graph_test.h b/test/graph_test.h
a b 268 268 template <typename Graph> 269 269 void checkGraphNodeMap(const Graph& G) { 270 270 typedef typename Graph::Node Node; 271 ignore_unused_warning<Node>(); 271 272 typedef typename Graph::NodeIt NodeIt; 272 273 273 274 typedef typename Graph::template NodeMap<int> IntNodeMap; … … 298 299 template <typename Graph> 299 300 void checkGraphRedNodeMap(const Graph& G) { 300 301 typedef typename Graph::Node Node; 302 ignore_unused_warning<Node>(); 301 303 typedef typename Graph::RedNodeIt RedNodeIt; 302 304 303 305 typedef typename Graph::template RedNodeMap<int> IntRedNodeMap; … … 328 330 template <typename Graph> 329 331 void checkGraphBlueNodeMap(const Graph& G) { 330 332 typedef typename Graph::Node Node; 333 ignore_unused_warning<Node>(); 331 334 typedef typename Graph::BlueNodeIt BlueNodeIt; 332 335 333 336 typedef typename Graph::template BlueNodeMap<int> IntBlueNodeMap; … … 358 361 template <typename Graph> 359 362 void checkGraphArcMap(const Graph& G) { 360 363 typedef typename Graph::Arc Arc; 364 ignore_unused_warning<Arc>(); 361 365 typedef typename Graph::ArcIt ArcIt; 362 366 363 367 typedef typename Graph::template ArcMap<int> IntArcMap; … … 388 392 template <typename Graph> 389 393 void checkGraphEdgeMap(const Graph& G) { 390 394 typedef typename Graph::Edge Edge; 395 ignore_unused_warning<Edge>(); 391 396 typedef typename Graph::EdgeIt EdgeIt; 392 397 393 398 typedef typename Graph::template EdgeMap<int> IntEdgeMap; -
test/graph_utils_test.cc
diff --git a/test/graph_utils_test.cc b/test/graph_utils_test.cc
a b 31 31 32 32 template <typename Digraph> 33 33 void checkFindArcs() { 34 TEMPLATE_DIGRAPH_TYPEDEFS (Digraph);34 TEMPLATE_DIGRAPH_TYPEDEFS_NOWARN(Digraph); 35 35 36 36 { 37 37 Digraph digraph; … … 108 108 109 109 template <typename Graph> 110 110 void checkFindEdges() { 111 TEMPLATE_GRAPH_TYPEDEFS (Graph);111 TEMPLATE_GRAPH_TYPEDEFS_NOWARN(Graph); 112 112 Graph graph; 113 113 for (int i = 0; i < 10; ++i) { 114 114 graph.addNode(); … … 143 143 template <class Digraph> 144 144 void checkDeg() 145 145 { 146 TEMPLATE_DIGRAPH_TYPEDEFS (Digraph);146 TEMPLATE_DIGRAPH_TYPEDEFS_NOWARN(Digraph); 147 147 148 148 const int nodeNum = 10; 149 149 const int arcNum = 100; … … 171 171 template <class Digraph> 172 172 void checkSnapDeg() 173 173 { 174 TEMPLATE_DIGRAPH_TYPEDEFS (Digraph);174 TEMPLATE_DIGRAPH_TYPEDEFS_NOWARN(Digraph); 175 175 176 176 Digraph g; 177 177 Node n1=g.addNode(); -
test/heap_test.cc
diff --git a/test/heap_test.cc b/test/heap_test.cc
a b 160 160 int main() { 161 161 162 162 typedef int Item; 163 ignore_unused_warning<Item>(); 163 164 typedef int Prio; 164 165 typedef RangeMap<int> ItemIntMap; 165 166 -
test/kruskal_test.cc
diff --git a/test/kruskal_test.cc b/test/kruskal_test.cc
a b 63 63 typedef ListGraph::Node Node; 64 64 typedef ListGraph::Edge Edge; 65 65 typedef ListGraph::NodeIt NodeIt; 66 ignore_unused_warning<NodeIt>(); 66 67 typedef ListGraph::ArcIt ArcIt; 67 68 ignore_unused_warning<ArcIt>(); 69 68 70 ListGraph G; 69 71 70 72 Node s=G.addNode(); -
test/maps_test.cc
diff --git a/test/maps_test.cc b/test/maps_test.cc
a b 398 398 check(v1[i++] == *it, "Something is wrong with LoggerBoolMap"); 399 399 400 400 typedef ListDigraph Graph; 401 DIGRAPH_TYPEDEFS (Graph);401 DIGRAPH_TYPEDEFS_NOWARN(Graph); 402 402 Graph gr; 403 403 404 404 Node n0 = gr.addNode(); … … 431 431 // IdMap, RangeIdMap 432 432 { 433 433 typedef ListDigraph Graph; 434 DIGRAPH_TYPEDEFS (Graph);434 DIGRAPH_TYPEDEFS_NOWARN(Graph); 435 435 436 436 checkConcept<ReadMap<Node, int>, IdMap<Graph, Node> >(); 437 437 checkConcept<ReadMap<Arc, int>, IdMap<Graph, Arc> >(); … … 503 503 // SourceMap, TargetMap, ForwardMap, BackwardMap, InDegMap, OutDegMap 504 504 { 505 505 typedef ListGraph Graph; 506 GRAPH_TYPEDEFS (Graph);506 GRAPH_TYPEDEFS_NOWARN(Graph); 507 507 508 508 checkConcept<ReadMap<Arc, Node>, SourceMap<Graph> >(); 509 509 checkConcept<ReadMap<Arc, Node>, TargetMap<Graph> >(); … … 552 552 // CrossRefMap 553 553 { 554 554 typedef ListDigraph Graph; 555 DIGRAPH_TYPEDEFS (Graph);555 DIGRAPH_TYPEDEFS_NOWARN(Graph); 556 556 557 557 checkConcept<ReadWriteMap<Node, int>, 558 558 CrossRefMap<Graph, Node, int> >(); … … 619 619 // CrossRefMap 620 620 { 621 621 typedef SmartDigraph Graph; 622 DIGRAPH_TYPEDEFS (Graph);622 DIGRAPH_TYPEDEFS_NOWARN(Graph); 623 623 624 624 checkConcept<ReadWriteMap<Node, int>, 625 625 CrossRefMap<Graph, Node, int> >(); … … 846 846 // mapFind(), mapFindIf(), mapCount(), mapCountIf() 847 847 // mapCopy(), mapCompare(), mapFill() 848 848 { 849 DIGRAPH_TYPEDEFS (SmartDigraph);849 DIGRAPH_TYPEDEFS_NOWARN(SmartDigraph); 850 850 851 851 SmartDigraph g; 852 852 Node n1 = g.addNode(); -
test/max_flow_test.cc
diff --git a/test/max_flow_test.cc b/test/max_flow_test.cc
a b 130 130 ::template SetFlowMap<FlowMap> 131 131 ::Create MaxFlowType; 132 132 typedef typename MF::Create MaxFlowType2; 133 ignore_unused_warning<MaxFlowType2>(); 133 134 MaxFlowType max_flow(me.g, me.cap, me.n, me.n); 134 135 const MaxFlowType& const_max_flow = max_flow; 135 136 … … 252 253 253 254 void checkInitPreflow() 254 255 { 255 DIGRAPH_TYPEDEFS (SmartDigraph);256 DIGRAPH_TYPEDEFS_NOWARN(SmartDigraph); 256 257 257 258 SmartDigraph g; 258 259 SmartDigraph::ArcMap<int> cap(g), iflow(g); … … 277 278 template <typename MF, typename SF> 278 279 void checkMaxFlowAlg(const char *input_lgf, typename MF::Value expected) { 279 280 typedef SmartDigraph Digraph; 280 DIGRAPH_TYPEDEFS (Digraph);281 DIGRAPH_TYPEDEFS_NOWARN(Digraph); 281 282 282 283 typedef typename MF::Value Value; 283 284 typedef Digraph::ArcMap<Value> CapMap; -
test/min_cost_arborescence_test.cc
diff --git a/test/min_cost_arborescence_test.cc b/test/min_cost_arborescence_test.cc
a b 133 133 134 134 int main() { 135 135 typedef SmartDigraph Digraph; 136 DIGRAPH_TYPEDEFS (Digraph);136 DIGRAPH_TYPEDEFS_NOWARN(Digraph); 137 137 138 138 typedef Digraph::ArcMap<double> CostMap; 139 139 -
test/min_cost_flow_test.cc
diff --git a/test/min_cost_flow_test.cc b/test/min_cost_flow_test.cc
a b 208 208 const SM& supply, const FM& flow, 209 209 SupplyType type = EQ ) 210 210 { 211 TEMPLATE_DIGRAPH_TYPEDEFS (GR);211 TEMPLATE_DIGRAPH_TYPEDEFS_NOWARN(GR); 212 212 213 213 for (ArcIt e(gr); e != INVALID; ++e) { 214 214 if (flow[e] < lower[e] || flow[e] > upper[e]) return false; … … 237 237 const CM& cost, const SM& supply, const FM& flow, 238 238 const PM& pi, SupplyType type ) 239 239 { 240 TEMPLATE_DIGRAPH_TYPEDEFS (GR);240 TEMPLATE_DIGRAPH_TYPEDEFS_NOWARN(GR); 241 241 242 242 bool opt = true; 243 243 for (ArcIt e(gr); opt && e != INVALID; ++e) { … … 271 271 const CM& cost, const SM& supply, const PM& pi, 272 272 typename CM::Value total ) 273 273 { 274 TEMPLATE_DIGRAPH_TYPEDEFS (GR);274 TEMPLATE_DIGRAPH_TYPEDEFS_NOWARN(GR); 275 275 276 276 typename CM::Value dual_cost = 0; 277 277 SM red_supply(gr); -
test/min_mean_cycle_test.cc
diff --git a/test/min_mean_cycle_test.cc b/test/min_mean_cycle_test.cc
a b 175 175 // Run various tests 176 176 { 177 177 typedef SmartDigraph GR; 178 DIGRAPH_TYPEDEFS (GR);178 DIGRAPH_TYPEDEFS_NOWARN(GR); 179 179 180 180 GR gr; 181 181 IntArcMap l1(gr), l2(gr), l3(gr), l4(gr); -
test/suurballe_test.cc
diff --git a/test/suurballe_test.cc b/test/suurballe_test.cc
a b 139 139 typename Digraph::Node s, typename Digraph::Node t, 140 140 int value ) 141 141 { 142 TEMPLATE_DIGRAPH_TYPEDEFS (Digraph);142 TEMPLATE_DIGRAPH_TYPEDEFS_NOWARN(Digraph); 143 143 for (ArcIt e(gr); e != INVALID; ++e) 144 144 if (!(flow[e] == 0 || flow[e] == 1)) return false; 145 145 … … 164 164 const FlowMap& flow, const PotentialMap& pi ) 165 165 { 166 166 // Check the "Complementary Slackness" optimality condition 167 TEMPLATE_DIGRAPH_TYPEDEFS (Digraph);167 TEMPLATE_DIGRAPH_TYPEDEFS_NOWARN(Digraph); 168 168 bool opt = true; 169 169 for (ArcIt e(gr); e != INVALID; ++e) { 170 170 typename CostMap::Value red_cost = … … 181 181 bool checkPath( const Digraph& gr, const Path& path, 182 182 typename Digraph::Node s, typename Digraph::Node t) 183 183 { 184 TEMPLATE_DIGRAPH_TYPEDEFS (Digraph);184 TEMPLATE_DIGRAPH_TYPEDEFS_NOWARN(Digraph); 185 185 Node n = s; 186 186 for (int i = 0; i < path.length(); ++i) { 187 187 if (gr.source(path.nth(i)) != n) return false; … … 193 193 194 194 int main() 195 195 { 196 DIGRAPH_TYPEDEFS (ListDigraph);196 DIGRAPH_TYPEDEFS_NOWARN(ListDigraph); 197 197 198 198 // Read the test digraph 199 199 ListDigraph digraph; -
test/time_measure_test.cc
diff --git a/test/time_measure_test.cc b/test/time_measure_test.cc
a b 17 17 */ 18 18 19 19 #include <lemon/time_measure.h> 20 #include <lemon/co ncept_check.h>20 #include <lemon/core.h> 21 21 22 22 using namespace lemon; 23 23 -
test/tsp_test.cc
diff --git a/test/tsp_test.cc b/test/tsp_test.cc
a b 125 125 // Tests a TSP algorithm on small graphs 126 126 template <typename TSP> 127 127 void tspTestSmall(const std::string &alg_name) { 128 GRAPH_TYPEDEFS (FullGraph);128 GRAPH_TYPEDEFS_NOWARN(FullGraph); 129 129 130 130 for (int n = 0; n <= 5; ++n) { 131 131 FullGraph g(n); … … 164 164 // Tests a TSP algorithm on random graphs 165 165 template <typename TSP> 166 166 void tspTestRandom(const std::string &alg_name) { 167 GRAPH_TYPEDEFS (FullGraph);167 GRAPH_TYPEDEFS_NOWARN(FullGraph); 168 168 169 169 FullGraph g(20); 170 170 FullGraph::NodeMap<dim2::Point<double> > pos(g); … … 259 259 }; 260 260 261 261 int main() { 262 GRAPH_TYPEDEFS (FullGraph);262 GRAPH_TYPEDEFS_NOWARN(FullGraph); 263 263 264 264 // metricCostTest(); 265 265 -
tools/dimacs-to-lgf.cc
diff --git a/tools/dimacs-to-lgf.cc b/tools/dimacs-to-lgf.cc
a b 48 48 typedef SmartDigraph Digraph; 49 49 50 50 typedef Digraph::Arc Arc; 51 ignore_unused_warning<Arc>(); 51 52 typedef Digraph::Node Node; 52 53 typedef Digraph::ArcIt ArcIt; 54 ignore_unused_warning<ArcIt>(); 53 55 typedef Digraph::NodeIt NodeIt; 56 ignore_unused_warning<NodeIt>(); 54 57 typedef Digraph::ArcMap<double> DoubleArcMap; 55 58 typedef Digraph::NodeMap<double> DoubleNodeMap; 56 59