COIN-OR::LEMON - Graph Library

Ticket #84: icc_compatibility_fixes.patch

File icc_compatibility_fixes.patch, 1.8 KB (added by Balazs Dezso, 16 years ago)
  • lemon/kruskal.h

    # HG changeset patch
    # User "Balazs Dezso <deba@inf.elte.hu>"
    # Date 1208453599 -7200
    # Node ID a067463a2bc6485cd1fdbcfd655076f4cb507cf0
    # Parent  6e7aee618f037c144a58dce8fb91cffbfa9ff11f
    Icc compatibility fixes
    
    diff -r 6e7aee618f03 -r a067463a2bc6 lemon/kruskal.h
    a b  
    212212      }
    213213    };
    214214
     215    template <typename T>
     216    struct RemoveConst {
     217      typedef T type;
     218    };
     219
     220    template <typename T>
     221    struct RemoveConst<const T> {
     222      typedef T type;
     223    };
     224
    215225    template <typename Graph, typename In, typename Out>
    216226    struct KruskalOutputSelector<Graph, In, Out,
    217227      typename enable_if<SequenceOutputIndicator<Out>, void>::type >
     
    219229      typedef typename In::value_type::second_type Value;
    220230
    221231      static Value kruskal(const Graph& graph, const In& in, Out& out) {
    222         typedef StoreBoolMap<Out> Map;
     232        typedef StoreBoolMap<typename RemoveConst<Out>::type> Map;
    223233        Map map(out);
    224234        return _kruskal_bits::kruskal(graph, in, map);
    225235      }
  • test/maps_test.cc

    diff -r 6e7aee618f03 -r a067463a2bc6 test/maps_test.cc
    a b  
    8585    checkConcept<ReadWriteMap<A,B>, ConstMap<A,B> >();
    8686    checkConcept<ReadWriteMap<A,C>, ConstMap<A,C> >();
    8787    ConstMap<A,B> map1;
    88     ConstMap<A,B> map2(B());
     88    ConstMap<A,B> map2 = B();
    8989    ConstMap<A,B> map3 = map1;
    9090    map1 = constMap<A>(B());
    9191    map1 = constMap<A,B>();
     
    143143  {
    144144    checkConcept<ReferenceMap<A,B,B&,const B&>, SparseMap<A,B> >();
    145145    SparseMap<A,B> map1;
    146     SparseMap<A,B> map2(B());
     146    SparseMap<A,B> map2 = B();
    147147    SparseMap<A,B> map3 = sparseMap<A,B>();
    148148    SparseMap<A,B> map4 = sparseMap<A>(B());
    149149