|
@@ -165,6 +165,11 @@ public:
|
|
|
using iterator = storage_iterator<false>;
|
|
using iterator = storage_iterator<false>;
|
|
|
/*! @brief Constant random access iterator type. */
|
|
/*! @brief Constant random access iterator type. */
|
|
|
using const_iterator = storage_iterator<true>;
|
|
using const_iterator = storage_iterator<true>;
|
|
|
|
|
+ /*! @brief Reverse iterator type. */
|
|
|
|
|
+ using reverse_iterator = Type *;
|
|
|
|
|
+ /*! @brief Constant reverse iterator type. */
|
|
|
|
|
+ using const_reverse_iterator = const Type *;
|
|
|
|
|
+
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* @brief Increases the capacity of a storage.
|
|
* @brief Increases the capacity of a storage.
|
|
@@ -209,14 +214,10 @@ public:
|
|
|
/**
|
|
/**
|
|
|
* @brief Returns an iterator to the beginning.
|
|
* @brief Returns an iterator to the beginning.
|
|
|
*
|
|
*
|
|
|
- * The returned iterator points to the first instance of the given type. If
|
|
|
|
|
- * the storage is empty, the returned iterator will be equal to `end()`.
|
|
|
|
|
- *
|
|
|
|
|
- * @note
|
|
|
|
|
- * Random access iterators stay true to the order imposed by a call to
|
|
|
|
|
- * either `sort` or `respect`.
|
|
|
|
|
|
|
+ * The returned iterator points to the first instance of the internal array.
|
|
|
|
|
+ * If the storage is empty, the returned iterator will be equal to `end()`.
|
|
|
*
|
|
*
|
|
|
- * @return An iterator to the first instance of the given type.
|
|
|
|
|
|
|
+ * @return An iterator to the first instance of the internal array.
|
|
|
*/
|
|
*/
|
|
|
[[nodiscard]] const_iterator cbegin() const ENTT_NOEXCEPT {
|
|
[[nodiscard]] const_iterator cbegin() const ENTT_NOEXCEPT {
|
|
|
const typename traits_type::difference_type pos = underlying_type::size();
|
|
const typename traits_type::difference_type pos = underlying_type::size();
|
|
@@ -238,15 +239,11 @@ public:
|
|
|
* @brief Returns an iterator to the end.
|
|
* @brief Returns an iterator to the end.
|
|
|
*
|
|
*
|
|
|
* The returned iterator points to the element following the last instance
|
|
* The returned iterator points to the element following the last instance
|
|
|
- * of the given type. Attempting to dereference the returned iterator
|
|
|
|
|
|
|
+ * of the internal array. Attempting to dereference the returned iterator
|
|
|
* results in undefined behavior.
|
|
* results in undefined behavior.
|
|
|
*
|
|
*
|
|
|
- * @note
|
|
|
|
|
- * Random access iterators stay true to the order imposed by a call to
|
|
|
|
|
- * either `sort` or `respect`.
|
|
|
|
|
- *
|
|
|
|
|
* @return An iterator to the element following the last instance of the
|
|
* @return An iterator to the element following the last instance of the
|
|
|
- * given type.
|
|
|
|
|
|
|
+ * internal array.
|
|
|
*/
|
|
*/
|
|
|
[[nodiscard]] const_iterator cend() const ENTT_NOEXCEPT {
|
|
[[nodiscard]] const_iterator cend() const ENTT_NOEXCEPT {
|
|
|
return const_iterator{instances, {}};
|
|
return const_iterator{instances, {}};
|
|
@@ -262,6 +259,53 @@ public:
|
|
|
return iterator{instances, {}};
|
|
return iterator{instances, {}};
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * @brief Returns a reverse iterator to the beginning.
|
|
|
|
|
+ *
|
|
|
|
|
+ * The returned iterator points to the first instance of the reversed
|
|
|
|
|
+ * internal array. If the storage is empty, the returned iterator will be
|
|
|
|
|
+ * equal to `rend()`.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @return An iterator to the first instance of the reversed internal array.
|
|
|
|
|
+ */
|
|
|
|
|
+ [[nodiscard]] const_reverse_iterator crbegin() const ENTT_NOEXCEPT {
|
|
|
|
|
+ return instances.data();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /*! @copydoc crbegin */
|
|
|
|
|
+ [[nodiscard]] const_reverse_iterator rbegin() const ENTT_NOEXCEPT {
|
|
|
|
|
+ return crbegin();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /*! @copydoc rbegin */
|
|
|
|
|
+ [[nodiscard]] reverse_iterator rbegin() ENTT_NOEXCEPT {
|
|
|
|
|
+ return instances.data();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * @brief Returns a reverse iterator to the end.
|
|
|
|
|
+ *
|
|
|
|
|
+ * The returned iterator points to the element following the last instance
|
|
|
|
|
+ * of the reversed internal array. Attempting to dereference the returned
|
|
|
|
|
+ * iterator results in undefined behavior.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @return An iterator to the element following the last instance of the
|
|
|
|
|
+ * reversed internal array.
|
|
|
|
|
+ */
|
|
|
|
|
+ [[nodiscard]] const_reverse_iterator crend() const ENTT_NOEXCEPT {
|
|
|
|
|
+ return crbegin() + instances.size();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /*! @copydoc crend */
|
|
|
|
|
+ [[nodiscard]] const_reverse_iterator rend() const ENTT_NOEXCEPT {
|
|
|
|
|
+ return crend();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /*! @copydoc rend */
|
|
|
|
|
+ [[nodiscard]] reverse_iterator rend() ENTT_NOEXCEPT {
|
|
|
|
|
+ return rbegin() + instances.size();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* @brief Returns the object associated with an entity.
|
|
* @brief Returns the object associated with an entity.
|
|
|
*
|
|
*
|