Michele Caini 8 лет назад
Родитель
Сommit
36bb55a9ce
2 измененных файлов с 11 добавлено и 6 удалено
  1. 1 3
      src/entt/entity/registry.hpp
  2. 10 3
      src/entt/entity/sparse_set.hpp

+ 1 - 3
src/entt/entity/registry.hpp

@@ -723,11 +723,9 @@ public:
      * comparison function should be equivalent to the following:
      *
      * @code{.cpp}
-     * bool(auto e1, auto e2)
+     * bool(const Component &, const Component &)
      * @endcode
      *
-     * Where `e1` and `e2` are valid entity identifiers.
-     *
      * @tparam Component Type of components to sort.
      * @tparam Compare Type of comparison function object.
      * @param compare A valid comparison function object.

+ 10 - 3
src/entt/entity/sparse_set.hpp

@@ -517,13 +517,20 @@ public:
      * iterators returns them in the expected order. See `begin` and `end` for
      * more details.
      *
+     * The comparison function object must return `true` if the first element
+     * is _less_ than the second one, `false` otherwise. The signature of the
+     * comparison function should be equivalent to the following:
+     *
+     * @code{.cpp}
+     * bool(const Type &, const Type &)
+     * @endcode
+     *
      * @note
      * Attempting to iterate elements using the raw pointer returned by `data`
      * gives no guarantees on the order, even though `sort` has been invoked.
      *
-     * @tparam Compare Type of the comparison function.
-     * @param compare A comparison function whose signature shall be equivalent
-     * to: `bool(const Type &, const Type &)`.
+     * @tparam Compare Type of comparison function object.
+     * @param compare A valid comparison function object.
      */
     template<typename Compare>
     void sort(Compare compare) {