[Lemon-commits] "Balazs Dezso: Icc compatibility fixes (ticket #84)

Lemon HG hg at lemon.cs.elte.hu
Thu Apr 17 19:51:38 CEST 2008


details:   http://lemon.cs.elte.hu/hg/lemon/rev/b82dc494bafc
changeset: 136:b82dc494bafc
user:      "Balazs Dezso <deba [at] inf.elte.hu>
date:      Thu Apr 17 19:33:19 2008 +0200
description:
	Icc compatibility fixes (ticket #84)

diffstat:

2 files changed, 13 insertions(+), 3 deletions(-)
lemon/kruskal.h   |   12 +++++++++++-
test/maps_test.cc |    4 ++--

diffs (50 lines):

diff -r 6e7aee618f03 -r b82dc494bafc lemon/kruskal.h
--- a/lemon/kruskal.h	Thu Apr 17 15:54:30 2008 +0100
+++ b/lemon/kruskal.h	Thu Apr 17 19:33:19 2008 +0200
@@ -212,6 +212,16 @@
       }
     };
 
+    template <typename T>
+    struct RemoveConst {
+      typedef T type;
+    };
+
+    template <typename T>
+    struct RemoveConst<const T> {
+      typedef T type;
+    };
+
     template <typename Graph, typename In, typename Out>
     struct KruskalOutputSelector<Graph, In, Out,
       typename enable_if<SequenceOutputIndicator<Out>, void>::type > 
@@ -219,7 +229,7 @@
       typedef typename In::value_type::second_type Value;
 
       static Value kruskal(const Graph& graph, const In& in, Out& out) {
-        typedef StoreBoolMap<Out> Map;
+        typedef StoreBoolMap<typename RemoveConst<Out>::type> Map;
         Map map(out);
         return _kruskal_bits::kruskal(graph, in, map);
       }
diff -r 6e7aee618f03 -r b82dc494bafc test/maps_test.cc
--- a/test/maps_test.cc	Thu Apr 17 15:54:30 2008 +0100
+++ b/test/maps_test.cc	Thu Apr 17 19:33:19 2008 +0200
@@ -85,7 +85,7 @@
     checkConcept<ReadWriteMap<A,B>, ConstMap<A,B> >();
     checkConcept<ReadWriteMap<A,C>, ConstMap<A,C> >();
     ConstMap<A,B> map1;
-    ConstMap<A,B> map2(B());
+    ConstMap<A,B> map2 = B();
     ConstMap<A,B> map3 = map1;
     map1 = constMap<A>(B());
     map1 = constMap<A,B>();
@@ -143,7 +143,7 @@
   {
     checkConcept<ReferenceMap<A,B,B&,const B&>, SparseMap<A,B> >();
     SparseMap<A,B> map1;
-    SparseMap<A,B> map2(B());
+    SparseMap<A,B> map2 = B();
     SparseMap<A,B> map3 = sparseMap<A,B>();
     SparseMap<A,B> map4 = sparseMap<A>(B());
 



More information about the Lemon-commits mailing list