diff --git a/TODO b/TODO index 4a76bb112..07ca40a57 100644 --- a/TODO +++ b/TODO @@ -7,10 +7,11 @@ * custom pools example (multi instance, tables, enable/disable, and so on...) WIP: +* HP: make non-const try_get thread safe, add user data to type_info +* HP: make pools available (registry/view/group), review operator| for views * HP: resource, forward the id to the loader from the cache and if constexpr the call to load, update doc and describe customization points * HP: any_vector for context variables * HP: make const registry::view thread safe, switch to a view{registry} model (long term goal) -* HP: review registry::get, registry::try_get * HP: weak reference wrapper example with custom storage * HP: paginate pools * HP: headless (sparse set only) view diff --git a/src/entt/entity/view.hpp b/src/entt/entity/view.hpp index 358968b20..925182c88 100644 --- a/src/entt/entity/view.hpp +++ b/src/entt/entity/view.hpp @@ -533,6 +533,15 @@ public: return iterable_view{*this}; } + /** + * @brief Combines two views in a _more specific_ one (friend function). + * @tparam Id A valid entity type (see entt_traits for more details). + * @tparam ELhs Filter list of the first view. + * @tparam CLhs Component list of the first view. + * @tparam ERhs Filter list of the second view. + * @tparam CRhs Component list of the second view. + * @return A more specific view. + */ template friend auto operator|(const basic_view, CLhs...> &, const basic_view, CRhs...> &); @@ -923,6 +932,15 @@ public: return iterable_view{*std::get<0>(pools)}; } + /** + * @brief Combines two views in a _more specific_ one (friend function). + * @tparam Id A valid entity type (see entt_traits for more details). + * @tparam ELhs Filter list of the first view. + * @tparam CLhs Component list of the first view. + * @tparam ERhs Filter list of the second view. + * @tparam CRhs Component list of the second view. + * @return A more specific view. + */ template friend auto operator|(const basic_view, CLhs...> &, const basic_view, CRhs...> &); @@ -951,7 +969,7 @@ basic_view(Storage &... storage) ENTT_NOEXCEPT * @tparam CRhs Component list of the second view. * @param lhs A valid reference to the first view. * @param rhs A valid reference to the second view. - * @return A more specific and correctly initialized view. + * @return A more specific view. */ template [[nodiscard]] auto operator|(const basic_view, CLhs...> &lhs, const basic_view, CRhs...> &rhs) {