Changeset 2031:080d51024ac5 in lemon-0.x for lemon/bits/edge_set_extender.h
- Timestamp:
- 04/03/06 11:45:23 (18 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2670
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lemon/bits/edge_set_extender.h
r1999 r2031 102 102 103 103 explicit NodeIt(const Graph& _graph) : graph(&_graph) { 104 _graph.first( *static_cast<Node*>(this));104 _graph.first(static_cast<Node&>(*this)); 105 105 } 106 106 … … 125 125 126 126 explicit EdgeIt(const Graph& _graph) : graph(&_graph) { 127 _graph.first( *static_cast<Edge*>(this));127 _graph.first(static_cast<Edge&>(*this)); 128 128 } 129 129 … … 236 236 template <typename CMap> 237 237 EdgeMap& operator=(const CMap& cmap) { 238 checkConcept<concept::ReadMap<Edge, _Value>, CMap>(); 239 const typename Parent::Graph* graph = Parent::getGraph(); 240 Edge it; 241 for (graph->first(it); it != INVALID; graph->next(it)) { 242 Parent::set(it, cmap[it]); 243 } 238 Parent::operator=(cmap); 244 239 return *this; 245 240 } 241 246 242 }; 247 243 … … 365 361 366 362 explicit NodeIt(const Graph& _graph) : graph(&_graph) { 367 _graph.first( *static_cast<Node*>(this));363 _graph.first(static_cast<Node&>(*this)); 368 364 } 369 365 … … 388 384 389 385 explicit EdgeIt(const Graph& _graph) : graph(&_graph) { 390 _graph.first( *static_cast<Edge*>(this));386 _graph.first(static_cast<Edge&>(*this)); 391 387 } 392 388 … … 459 455 460 456 explicit UEdgeIt(const Graph& _graph) : graph(&_graph) { 461 _graph.first( *static_cast<UEdge*>(this));457 _graph.first(static_cast<UEdge&>(*this)); 462 458 } 463 459 … … 557 553 template <typename CMap> 558 554 EdgeMap& operator=(const CMap& cmap) { 559 checkConcept<concept::ReadMap<Edge, _Value>, CMap>(); 560 const typename Parent::Graph* graph = Parent::getGraph(); 561 Edge it; 562 for (graph->first(it); it != INVALID; graph->next(it)) { 563 Parent::set(it, cmap[it]); 564 } 555 Parent::operator=(cmap); 565 556 return *this; 566 557 } 558 567 559 }; 568 560 … … 577 569 UEdgeMap(const Graph& _g) 578 570 : Parent(_g) {} 571 579 572 UEdgeMap(const Graph& _g, const _Value& _v) 580 573 : Parent(_g, _v) {} … … 586 579 template <typename CMap> 587 580 UEdgeMap& operator=(const CMap& cmap) { 588 checkConcept<concept::ReadMap<UEdge, _Value>, CMap>(); 589 const typename Parent::Graph* graph = Parent::getGraph(); 590 UEdge it; 591 for (graph->first(it); it != INVALID; graph->next(it)) { 592 Parent::set(it, cmap[it]); 593 } 581 Parent::operator=(cmap); 594 582 return *this; 595 583 } 584 596 585 }; 597 586
Note: See TracChangeset
for help on using the changeset viewer.