COIN-OR::LEMON - Graph Library

Changeset 2423:02fedd6652c6 in lemon-0.x


Ignore:
Timestamp:
04/19/07 17:09:08 (17 years ago)
Author:
Balazs Dezso
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@3259
Message:

Corrections on StoreBoolMap?

  • *insert_iterator has void value_type
  • use const setting
File:
1 edited

Legend:

Unmodified
Added
Removed
  • lemon/maps.h

    r2391 r2423  
    10451045    return NotMap<M>(m);
    10461046  }
    1047 
     1047 
    10481048  template <typename M>
    10491049  inline NotWriteMap<M> notMap(M &m) {
     
    10521052
    10531053  namespace _maps_bits {
     1054
    10541055    template <typename Value>
    10551056    struct Identity {
    10561057      typedef Value argument_type;
    10571058      typedef Value result_type;
    1058       Value operator()(const Value& val) {
     1059      Value operator()(const Value& val) const {
    10591060        return val;
    10601061      }
    10611062    };
     1063
     1064    template <typename _Iterator, typename Enable = void>
     1065    struct IteratorTraits {
     1066      typedef typename std::iterator_traits<_Iterator>::value_type Value;
     1067    };
     1068
     1069    template <typename _Iterator>
     1070    struct IteratorTraits<_Iterator,
     1071      typename exists<typename _Iterator::container_type>::type>
     1072    {
     1073      typedef typename _Iterator::container_type::value_type Value;
     1074    };
     1075
    10621076  }
    10631077 
     
    10861100  ///\endcode
    10871101  template <typename _Iterator,
    1088             typename _Functor =
    1089             _maps_bits::Identity<typename std::iterator_traits<_Iterator>::value_type> >
     1102            typename _Functor =
     1103            _maps_bits::Identity<typename _maps_bits::
     1104                                 IteratorTraits<_Iterator>::Value> >
    10901105  class StoreBoolMap {
    10911106  public:
     
    11121127
    11131128    /// Setter function of the map
    1114     void set(const Key& key, Value value) {
     1129    void set(const Key& key, Value value) const {
    11151130      if (value) {
    11161131        *_end++ = _functor(key);
     
    11191134   
    11201135  private:
    1121     Iterator _begin, _end;
     1136    Iterator _begin;
     1137    mutable Iterator _end;
    11221138    Functor _functor;
    11231139  };
Note: See TracChangeset for help on using the changeset viewer.