Changeset 209:765619b7cbb2 in lemon-1.2 for lemon/maps.h
- Timestamp:
- 07/13/08 20:51:02 (17 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lemon/maps.h
r167 r209 1 /* -*- C++-*-1 /* -*- mode: C++; indent-tabs-mode: nil; -*- 2 2 * 3 * This file is a part of LEMON, a generic C++ optimization library 3 * This file is a part of LEMON, a generic C++ optimization library. 4 4 * 5 5 * Copyright (C) 2003-2008 … … 405 405 typename Map::iterator it = _map.lower_bound(k); 406 406 if (it != _map.end() && !_map.key_comp()(k, it->first)) 407 407 return it->second; 408 408 else 409 409 return _map.insert(it, std::make_pair(k, _value))->second; 410 410 } 411 411 … … 414 414 typename Map::const_iterator it = _map.find(k); 415 415 if (it != _map.end()) 416 416 return it->second; 417 417 else 418 418 return _value; 419 419 } 420 420 … … 423 423 typename Map::iterator it = _map.lower_bound(k); 424 424 if (it != _map.end() && !_map.key_comp()(k, it->first)) 425 425 it->second = v; 426 426 else 427 427 _map.insert(it, std::make_pair(k, v)); 428 428 } 429 429 … … 545 545 /// \todo Check the requirements. 546 546 template<typename M1, typename M2, typename F, 547 547 typename V = typename F::result_type> 548 548 class CombineMap : public MapBase<typename M1::Key, V> { 549 549 const M1 &_m1; … … 616 616 /// \sa MapToFunctor 617 617 template<typename F, 618 619 618 typename K = typename F::argument_type, 619 typename V = typename F::result_type> 620 620 class FunctorToMap : public MapBase<K, V> { 621 621 F _f; … … 1318 1318 1319 1319 /// @} 1320 1320 1321 1321 // Logical maps and map adaptors: 1322 1322 … … 1716 1716 #else 1717 1717 template <typename It, 1718 1718 typename Ke=typename _maps_bits::IteratorTraits<It>::Value> 1719 1719 #endif 1720 1720 class LoggerBoolMap { … … 1742 1742 void set(const Key& key, Value value) { 1743 1743 if (value) { 1744 1744 *_end++ = key; 1745 1745 } 1746 1746 } … … 1750 1750 Iterator _end; 1751 1751 }; 1752 1752 1753 1753 /// Returns a \ref LoggerBoolMap class 1754 1754
Note: See TracChangeset
for help on using the changeset viewer.