view: size -> size_hint for multi component views (close #553)
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user