|
@@ -660,9 +660,11 @@ public:
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* @brief Returns the number of entities that have the given element.
|
|
* @brief Returns the number of entities that have the given element.
|
|
|
|
|
+ * @tparam Pol Dummy template parameter used for sfinae purposes only.
|
|
|
* @return Number of entities that have the given element.
|
|
* @return Number of entities that have the given element.
|
|
|
*/
|
|
*/
|
|
|
- [[nodiscard]] size_type size() const noexcept {
|
|
|
|
|
|
|
+ template<typename..., deletion_policy Pol = Policy>
|
|
|
|
|
+ [[nodiscard]] std::enable_if_t<Pol != deletion_policy::in_place, size_type> size() const noexcept {
|
|
|
if constexpr(Policy == deletion_policy::swap_and_pop) {
|
|
if constexpr(Policy == deletion_policy::swap_and_pop) {
|
|
|
return leading ? leading->size() : size_type{};
|
|
return leading ? leading->size() : size_type{};
|
|
|
} else {
|
|
} else {
|
|
@@ -671,6 +673,16 @@ public:
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * @brief Estimates the number of entities iterated by the view.
|
|
|
|
|
+ * @tparam Pol Dummy template parameter used for sfinae purposes only.
|
|
|
|
|
+ * @return Estimated number of entities iterated by the view.
|
|
|
|
|
+ */
|
|
|
|
|
+ template<typename..., deletion_policy Pol = Policy>
|
|
|
|
|
+ [[nodiscard]] std::enable_if_t<Pol == deletion_policy::in_place, size_type> size_hint() const noexcept {
|
|
|
|
|
+ return leading ? leading->size() : size_type{};
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* @brief Checks whether a view is empty.
|
|
* @brief Checks whether a view is empty.
|
|
|
* @return True if the view is empty, false otherwise.
|
|
* @return True if the view is empty, false otherwise.
|