Also check ReferenceMapTag in concept checks (#312)
authorPeter Kovacs <kpeter@inf.elte.hu>
Thu, 20 Aug 2009 20:34:30 +0200
changeset 718703ebf476a1d
parent 683 9f529abcaebf
child 719 ba79e8d64448
child 802 994c7df296c9
Also check ReferenceMapTag in concept checks (#312)
lemon/bits/map_extender.h
lemon/concepts/maps.h
     1.1 --- a/lemon/bits/map_extender.h	Thu Jun 11 23:13:24 2009 +0200
     1.2 +++ b/lemon/bits/map_extender.h	Thu Aug 20 20:34:30 2009 +0200
     1.3 @@ -49,6 +49,8 @@
     1.4      typedef typename Parent::Reference Reference;
     1.5      typedef typename Parent::ConstReference ConstReference;
     1.6  
     1.7 +    typedef typename Parent::ReferenceMapTag ReferenceMapTag;
     1.8 +
     1.9      class MapIt;
    1.10      class ConstMapIt;
    1.11  
    1.12 @@ -191,6 +193,8 @@
    1.13      typedef typename Parent::Reference Reference;
    1.14      typedef typename Parent::ConstReference ConstReference;
    1.15  
    1.16 +    typedef typename Parent::ReferenceMapTag ReferenceMapTag;
    1.17 +
    1.18      class MapIt;
    1.19      class ConstMapIt;
    1.20  
     2.1 --- a/lemon/concepts/maps.h	Thu Jun 11 23:13:24 2009 +0200
     2.2 +++ b/lemon/concepts/maps.h	Thu Aug 20 20:34:30 2009 +0200
     2.3 @@ -182,7 +182,8 @@
     2.4  
     2.5        template<typename _ReferenceMap>
     2.6        struct Constraints {
     2.7 -        void constraints() {
     2.8 +        typename enable_if<typename _ReferenceMap::ReferenceMapTag, void>::type
     2.9 +        constraints() {
    2.10            checkConcept<ReadWriteMap<K, T>, _ReferenceMap >();
    2.11            ref = m[key];
    2.12            m[key] = val;