view: size -> size_hint for multi component views (close #553)

This commit is contained in:
Michele Caini
2020-09-11 12:09:53 +02:00
parent eccfec4b4f
commit 9290b4eecc

View File

@@ -350,12 +350,21 @@ public:
return std::get<pool_type<Comp> *>(pools)->size();
}
/**
* @brief Estimates the number of entities iterated by the view.
* @return Estimated number of entities iterated by the view.
*/
[[nodiscard]] size_type size_hint() const ENTT_NOEXCEPT {
return (std::min)({ std::get<pool_type<Component> *>(pools)->size()... });
}
/**
* @brief Estimates the number of entities iterated by the view.
* @return Estimated number of entities iterated by the view.
*/
[[deprecated("misleading name, use size_hint instead")]]
[[nodiscard]] size_type size() const ENTT_NOEXCEPT {
return (std::min)({ std::get<pool_type<Component> *>(pools)->size()... });
return size_hint();
}
/**