Bläddra i källkod

Compress get() without weakening its reference semantics.

Sam Jaffe 4 år sedan
förälder
incheckning
2b2f4cee8f
1 ändrade filer med 1 tillägg och 4 borttagningar
  1. 1 4
      include/iterator/detail/recursive_iterator_base.hpp

+ 1 - 4
include/iterator/detail/recursive_iterator_base.hpp

@@ -68,10 +68,7 @@ namespace iterator { namespace detail {
      * underlying value/reference type, and nested containers to propogate
      * a tuple or a pair as necessary.
      */
-    std::tuple<first_type &, second_type &> get() const {
-      auto & pair = super::operator*();
-      return std::tie(pair.first, pair.second);
-    }
+    auto get() const { return std::tie((**this).first, (**this).second); }
   };
 
 }}