Răsfoiți Sursa

view: use operator| within join

Michele Caini 1 an în urmă
părinte
comite
60a707f9e4
2 a modificat fișierele cu 3 adăugiri și 4 ștergeri
  1. 1 0
      TODO
  2. 2 4
      src/entt/entity/view.hpp

+ 1 - 0
TODO

@@ -43,3 +43,4 @@ TODO:
 * any cdynamic to support const ownership construction
 * track meta context on meta elements
 * safer meta_data/meta_func (no blind indirections)
+* review tests, write doc for view::join and decide whether I like it or prefer operator| for consistency :)

+ 2 - 4
src/entt/entity/view.hpp

@@ -650,8 +650,7 @@ public:
      */
     template<typename OGet>
     [[nodiscard]] auto join(OGet &other) const noexcept {
-        return internal::view_pack<basic_view<get_t<Get..., OGet>, exclude_t<Exclude...>>>(
-            *this, basic_view<get_t<OGet>, exclude_t<>>{other}, std::index_sequence_for<Get...>{}, std::index_sequence_for<Exclude...>{}, std::index_sequence_for<OGet>{}, std::index_sequence_for<>{});
+        return *this | basic_view<get_t<OGet>, exclude_t<>>{other};
     }
 
     /**
@@ -1092,8 +1091,7 @@ public:
      */
     template<typename OGet>
     [[nodiscard]] auto join(OGet &other) const noexcept {
-        return internal::view_pack<basic_view<get_t<Get, OGet>, exclude_t<>>>(
-            *this, basic_view<get_t<OGet>, exclude_t<>>{other}, std::index_sequence_for<Get>{}, std::index_sequence_for<>{}, std::index_sequence_for<OGet>{}, std::index_sequence_for<>{});
+        return *this | basic_view<get_t<OGet>, exclude_t<>>{other};
     }
 
     /**