Просмотр исходного кода

delegate: removed redundant calls to delegate constructors

Michele Caini 5 лет назад
Родитель
Сommit
158c2ab76e
2 измененных файлов с 4 добавлено и 10 удалено
  1. 1 1
      TODO
  2. 3 9
      src/entt/signal/delegate.hpp

+ 1 - 1
TODO

@@ -7,7 +7,7 @@
 * custom pools example (multi instance, tables, enable/disable, and so on...)
 
 WIP:
-* HP: make non-const try_get thread safe, add user data to type_info
+* HP: add user data to type_info
 * HP: make pools available (registry/view/group), review operator| for views
 * HP: resource, forward the id to the loader from the cache and if constexpr the call to load, update doc and describe customization points
 * HP: any_vector for context variables

+ 3 - 9
src/entt/signal/delegate.hpp

@@ -141,9 +141,7 @@ public:
      * @tparam Candidate Function or member to connect to the delegate.
      */
     template<auto Candidate>
-    delegate(connect_arg_t<Candidate>) ENTT_NOEXCEPT
-        : delegate{}
-    {
+    delegate(connect_arg_t<Candidate>) ENTT_NOEXCEPT {
         connect<Candidate>();
     }
 
@@ -155,9 +153,7 @@ public:
      * @param value_or_instance A valid object that fits the purpose.
      */
     template<auto Candidate, typename Type>
-    delegate(connect_arg_t<Candidate>, Type &&value_or_instance) ENTT_NOEXCEPT
-        : delegate{}
-    {
+    delegate(connect_arg_t<Candidate>, Type &&value_or_instance) ENTT_NOEXCEPT {
         connect<Candidate>(std::forward<Type>(value_or_instance));
     }
 
@@ -167,9 +163,7 @@ public:
      * @param function Function to connect to the delegate.
      * @param payload User defined arbitrary data.
      */
-    delegate(function_type *function, const void *payload = nullptr) ENTT_NOEXCEPT
-        : delegate{}
-    {
+    delegate(function_type *function, const void *payload = nullptr) ENTT_NOEXCEPT {
         connect(function, payload);
     }