[Lemon-commits] Balazs Dezso: Fix problem with temporal iterator...

Lemon HG hg at lemon.cs.elte.hu
Tue Apr 14 20:42:50 CEST 2015


details:   http://lemon.cs.elte.hu/hg/lemon/rev/93d455c647be
changeset: 1339:93d455c647be
user:      Balazs Dezso <deba [at] google.com>
date:      Tue Apr 14 16:36:45 2015 +0200
description:
	Fix problem with temporal iterator parameters (#325)

diffstat:

 lemon/bits/stl_iterators.h |  18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)

diffs (39 lines):

diff --git a/lemon/bits/stl_iterators.h b/lemon/bits/stl_iterators.h
--- a/lemon/bits/stl_iterators.h
+++ b/lemon/bits/stl_iterators.h
@@ -55,12 +55,13 @@
   /// \c P is the type of the parameter of the constructor of \c LIT.
   template<class LIT, class P>
   class LemonRangeWrapper1 {
-    const P &_p;
     typedef LemonItWrapper<LIT> It;
+    It _begin;
+    
   public:
-    LemonRangeWrapper1(const P &p) : _p(p) {}
+    LemonRangeWrapper1(const P &p) : _begin(LIT(p)) {}
     It begin() const {
-      return It(LIT(_p));
+      return _begin;
     }
     It end() const {
       return It(lemon::INVALID);
@@ -80,13 +81,12 @@
   /// of the constructor of \c LIT.
   template<class LIT, class P1, class P2>
   class LemonRangeWrapper2 {
-    const P1 &_p1;
-    const P2 &_p2;
-    typedef LemonItWrapper<LIT> It;
-  public:
-    LemonRangeWrapper2(const P1 &p1, const P2 &p2) : _p1(p1), _p2(p2) {}
+    typedef LemonItWrapper<LIT> It; 
+    It _begin;
+ public:
+    LemonRangeWrapper2(const P1 &p1, const P2 &p2) : _begin(LIT(p1, p2)) {}
     It begin() const {
-      return It(LIT(_p1, _p2));
+      return _begin;
     }
     It end() const {
       return It(lemon::INVALID);


More information about the Lemon-commits mailing list