]> git.ipfire.org Git - thirdparty/vectorscan.git/commitdiff
flat_set: modernize iter_wrapper ctors
authorJustin Viiret <justin.viiret@intel.com>
Mon, 5 Dec 2016 01:39:25 +0000 (12:39 +1100)
committerMatthew Barr <matthew.barr@intel.com>
Wed, 26 Apr 2017 04:41:30 +0000 (14:41 +1000)
src/util/ue2_containers.h

index 91115b18742102a8ab1917f31439f4278a94a8b7..0292741c844ae8d55bf3642fbec94a86a2631854 100644 (file)
@@ -58,8 +58,8 @@ class iter_wrapper
     : public boost::iterator_facade<iter_wrapper<WrappedIter, Value>, Value,
                                     boost::random_access_traversal_tag> {
 public:
-    iter_wrapper() {}
-    explicit iter_wrapper(const WrappedIter &it_in) : it(it_in) {}
+    iter_wrapper() = default;
+    explicit iter_wrapper(WrappedIter it_in) : it(std::move(it_in)) {}
 
     // Templated copy-constructor to allow for interoperable iterator and
     // const_iterator.
@@ -68,10 +68,10 @@ private:
 
 public:
     template <class OtherIter, class OtherValue>
-    iter_wrapper(const iter_wrapper<OtherIter, OtherValue> &other,
+    iter_wrapper(iter_wrapper<OtherIter, OtherValue> other,
                  typename std::enable_if<std::is_convertible<
                      OtherIter, WrappedIter>::value>::type * = nullptr)
-        : it(other.it) {}
+        : it(std::move(other.it)) {}
 
     WrappedIter get() const { return it; }