[Lemon-commits] Peter Kovacs: Also check ReferenceMapTag in conc...

Lemon HG hg at lemon.cs.elte.hu
Fri Sep 25 09:43:23 CEST 2009


details:   http://lemon.cs.elte.hu/hg/lemon/rev/703ebf476a1d
changeset: 771:703ebf476a1d
user:      Peter Kovacs <kpeter [at] inf.elte.hu>
date:      Thu Aug 20 20:34:30 2009 +0200
description:
	Also check ReferenceMapTag in concept checks (#312)

diffstat:

 lemon/bits/map_extender.h |  4 ++++
 lemon/concepts/maps.h     |  3 ++-
 2 files changed, 6 insertions(+), 1 deletions(-)

diffs (34 lines):

diff --git a/lemon/bits/map_extender.h b/lemon/bits/map_extender.h
--- a/lemon/bits/map_extender.h
+++ b/lemon/bits/map_extender.h
@@ -49,6 +49,8 @@
     typedef typename Parent::Reference Reference;
     typedef typename Parent::ConstReference ConstReference;
 
+    typedef typename Parent::ReferenceMapTag ReferenceMapTag;
+
     class MapIt;
     class ConstMapIt;
 
@@ -191,6 +193,8 @@
     typedef typename Parent::Reference Reference;
     typedef typename Parent::ConstReference ConstReference;
 
+    typedef typename Parent::ReferenceMapTag ReferenceMapTag;
+
     class MapIt;
     class ConstMapIt;
 
diff --git a/lemon/concepts/maps.h b/lemon/concepts/maps.h
--- a/lemon/concepts/maps.h
+++ b/lemon/concepts/maps.h
@@ -182,7 +182,8 @@
 
       template<typename _ReferenceMap>
       struct Constraints {
-        void constraints() {
+        typename enable_if<typename _ReferenceMap::ReferenceMapTag, void>::type
+        constraints() {
           checkConcept<ReadWriteMap<K, T>, _ReferenceMap >();
           ref = m[key];
           m[key] = val;



More information about the Lemon-commits mailing list