Browse Source

container: difference_type

Michele Caini 1 year ago
parent
commit
f0c763b984
4 changed files with 7 additions and 0 deletions
  1. 1 0
      TODO
  2. 2 0
      src/entt/container/dense_map.hpp
  3. 2 0
      src/entt/container/dense_set.hpp
  4. 2 0
      src/entt/container/table.hpp

+ 1 - 0
TODO

@@ -39,4 +39,5 @@ TODO:
 * allow passing arguments to meta setter/getter (we can fallback on meta invoke for everything probably)
 * delegate/sigh: forward connect/disconnect from & to *
 * a few more tests on the improved shrink_to_fit for sparse arrays
+* sparse_set/storage/...: difference_type (?)
 * -Wextra

+ 2 - 0
src/entt/container/dense_map.hpp

@@ -354,6 +354,8 @@ public:
     using value_type = std::pair<const Key, Type>;
     /*! @brief Unsigned integer type. */
     using size_type = std::size_t;
+    /*! @brief Signed integer type. */
+    using difference_type = std::ptrdiff_t;
     /*! @brief Type of function to use to hash the keys. */
     using hasher = Hash;
     /*! @brief Type of function to use to compare the keys for equality. */

+ 2 - 0
src/entt/container/dense_set.hpp

@@ -295,6 +295,8 @@ public:
     using value_type = Type;
     /*! @brief Unsigned integer type. */
     using size_type = std::size_t;
+    /*! @brief Signed integer type. */
+    using difference_type = std::ptrdiff_t;
     /*! @brief Type of function to use to hash the elements. */
     using hasher = Hash;
     /*! @brief Type of function to use to compare the elements for equality. */

+ 2 - 0
src/entt/container/table.hpp

@@ -152,6 +152,8 @@ class basic_table {
 public:
     /*! @brief Unsigned integer type. */
     using size_type = std::size_t;
+    /*! @brief Signed integer type. */
+    using difference_type = std::ptrdiff_t;
     /*! @brief Input iterator type. */
     using iterator = internal::table_iterator<typename Container::iterator...>;
     /*! @brief Constant input iterator type. */