Przeglądaj źródła

iterable_adaptor: move iterators on construction

Michele Caini 3 lat temu
rodzic
commit
b92e4f7e65
1 zmienionych plików z 2 dodań i 2 usunięć
  1. 2 2
      src/entt/core/iterator.hpp

+ 2 - 2
src/entt/core/iterator.hpp

@@ -78,8 +78,8 @@ struct iterable_adaptor final {
      * @param to End iterator.
      * @param to End iterator.
      */
      */
     constexpr iterable_adaptor(iterator from, sentinel to)
     constexpr iterable_adaptor(iterator from, sentinel to)
-        : first{from},
-          last{to} {}
+        : first{std::move(from)},
+          last{std::move(to)} {}
 
 
     /**
     /**
      * @brief Returns an iterator to the beginning.
      * @brief Returns an iterator to the beginning.