diff --git a/src/entt/core/hashed_string.hpp b/src/entt/core/hashed_string.hpp index 1a711ea59..fef4c87c5 100644 --- a/src/entt/core/hashed_string.hpp +++ b/src/entt/core/hashed_string.hpp @@ -64,7 +64,7 @@ class hashed_string { }; // Fowler–Noll–Vo hash function v. 1a - the good - inline static constexpr ENTT_ID_TYPE helper(ENTT_ID_TYPE partial, const char *curr) ENTT_NOEXCEPT { + static constexpr ENTT_ID_TYPE helper(ENTT_ID_TYPE partial, const char *curr) ENTT_NOEXCEPT { return curr[0] == 0 ? partial : helper((partial^curr[0])*traits_type::prime, curr+1); } @@ -88,7 +88,7 @@ public: * @return The numeric representation of the string. */ template - inline static constexpr hash_type to_value(const char (&str)[N]) ENTT_NOEXCEPT { + static constexpr hash_type to_value(const char (&str)[N]) ENTT_NOEXCEPT { return helper(traits_type::offset, str); } @@ -97,7 +97,7 @@ public: * @param wrapper Helps achieving the purpose by relying on overloading. * @return The numeric representation of the string. */ - inline static hash_type to_value(const_wrapper wrapper) ENTT_NOEXCEPT { + static hash_type to_value(const_wrapper wrapper) ENTT_NOEXCEPT { return helper(traits_type::offset, wrapper.str); } @@ -107,7 +107,7 @@ public: * @param size Length of the string to hash. * @return The numeric representation of the string. */ - inline static hash_type to_value(const char *str, std::size_t size) ENTT_NOEXCEPT { + static hash_type to_value(const char *str, std::size_t size) ENTT_NOEXCEPT { ENTT_ID_TYPE partial{traits_type::offset}; while(size--) { partial = (partial^(str++)[0])*traits_type::prime; } return partial; diff --git a/src/entt/entity/actor.hpp b/src/entt/entity/actor.hpp index 6340eb628..715200b31 100644 --- a/src/entt/entity/actor.hpp +++ b/src/entt/entity/actor.hpp @@ -151,12 +151,12 @@ struct basic_actor { * @brief Returns a reference to the underlying registry. * @return A reference to the underlying registry. */ - inline const registry_type & backend() const ENTT_NOEXCEPT { + const registry_type & backend() const ENTT_NOEXCEPT { return *reg; } /*! @copydoc backend */ - inline registry_type & backend() ENTT_NOEXCEPT { + registry_type & backend() ENTT_NOEXCEPT { return const_cast(std::as_const(*this).backend()); } @@ -164,7 +164,7 @@ struct basic_actor { * @brief Returns the entity associated with an actor. * @return The entity associated with the actor. */ - inline entity_type entity() const ENTT_NOEXCEPT { + entity_type entity() const ENTT_NOEXCEPT { return entt; } diff --git a/src/entt/entity/group.hpp b/src/entt/entity/group.hpp index a6899d93b..40d00fdd3 100644 --- a/src/entt/entity/group.hpp +++ b/src/entt/entity/group.hpp @@ -95,7 +95,7 @@ class basic_group> { {} template - inline void traverse(Func func, type_list) const { + void traverse(Func func, type_list) const { for(const auto entt: *handler) { if constexpr(std::is_invocable_v({}))...>) { func(std::get *>(pools)->get(entt)...); @@ -336,7 +336,7 @@ public: * @param func A valid function object. */ template - inline void each(Func func) const { + void each(Func func) const { traverse(std::move(func), type_list{}); } @@ -361,7 +361,7 @@ public: * @param func A valid function object. */ template - inline void less(Func func) const { + void less(Func func) const { using non_empty_get = type_list_cat_t, type_list<>, type_list>...>; traverse(std::move(func), non_empty_get{}); } @@ -458,7 +458,7 @@ class basic_group, Owned...> { {} template - inline void traverse(Func func, type_list, type_list) const { + void traverse(Func func, type_list, type_list) const { auto raw = std::make_tuple((std::get *>(pools)->end() - *length)...); [[maybe_unused]] auto data = std::get<0>(pools)->sparse_set::end() - *length; @@ -700,7 +700,7 @@ public: * @param func A valid function object. */ template - inline void each(Func func) const { + void each(Func func) const { traverse(std::move(func), type_list{}, type_list{}); } @@ -725,7 +725,7 @@ public: * @param func A valid function object. */ template - inline void less(Func func) const { + void less(Func func) const { using non_empty_owned = type_list_cat_t, type_list<>, type_list>...>; using non_empty_get = type_list_cat_t, type_list<>, type_list>...>; traverse(std::move(func), non_empty_owned{}, non_empty_get{}); diff --git a/src/entt/entity/helper.hpp b/src/entt/entity/helper.hpp index 29cd08a35..5e48f7b1a 100644 --- a/src/entt/entity/helper.hpp +++ b/src/entt/entity/helper.hpp @@ -34,7 +34,7 @@ struct as_view { * @return A newly created view. */ template - inline operator entt::basic_view() const { + operator entt::basic_view() const { return reg.template view(); } @@ -87,7 +87,7 @@ struct as_group { * @return A newly created group. */ template - inline operator entt::basic_group, Owned...>() const { + operator entt::basic_group, Owned...>() const { return reg.template group(); } @@ -153,7 +153,7 @@ void dependency(basic_registry ®, const Entity entt, const Component * @param sink A sink object properly initialized. */ template -inline void connect(sink &, const Entity, Component &)> sink) { +void connect(sink &, const Entity, Component &)> sink) { sink.template connect>(); } @@ -177,7 +177,7 @@ inline void connect(sink &, const Entity, Component * @param sink A sink object properly initialized. */ template -inline void disconnect(sink &, const Entity, Component &)> sink) { +void disconnect(sink &, const Entity, Component &)> sink) { sink.template disconnect>(); } diff --git a/src/entt/entity/prototype.hpp b/src/entt/entity/prototype.hpp index 5adef9f67..3bbd996ca 100644 --- a/src/entt/entity/prototype.hpp +++ b/src/entt/entity/prototype.hpp @@ -189,7 +189,7 @@ public: /*! @copydoc get */ template - inline decltype(auto) get() ENTT_NOEXCEPT { + decltype(auto) get() ENTT_NOEXCEPT { if constexpr(sizeof...(Component) == 1) { return (const_cast(std::as_const(*this).template get()), ...); } else { @@ -214,7 +214,7 @@ public: /*! @copydoc try_get */ template - inline auto try_get() ENTT_NOEXCEPT { + auto try_get() ENTT_NOEXCEPT { if constexpr(sizeof...(Component) == 1) { return (const_cast(std::as_const(*this).template try_get()), ...); } else { @@ -263,7 +263,7 @@ public: * * @return A valid entity identifier. */ - inline entity_type create() const { + entity_type create() const { return create(*reg); } @@ -314,7 +314,7 @@ public: * * @param dst A valid entity identifier. */ - inline void assign(const entity_type dst) const { + void assign(const entity_type dst) const { assign(*reg, dst); } @@ -361,7 +361,7 @@ public: * * @param dst A valid entity identifier. */ - inline void assign_or_replace(const entity_type dst) const { + void assign_or_replace(const entity_type dst) const { assign_or_replace(*reg, dst); } @@ -386,7 +386,7 @@ public: * @param other A valid reference to a registry. * @param dst A valid entity identifier. */ - inline void operator()(registry_type &other, const entity_type dst) const ENTT_NOEXCEPT { + void operator()(registry_type &other, const entity_type dst) const ENTT_NOEXCEPT { assign(other, dst); } @@ -410,7 +410,7 @@ public: * * @param dst A valid entity identifier. */ - inline void operator()(const entity_type dst) const ENTT_NOEXCEPT { + void operator()(const entity_type dst) const ENTT_NOEXCEPT { assign(*reg, dst); } @@ -432,7 +432,7 @@ public: * @param other A valid reference to a registry. * @return A valid entity identifier. */ - inline entity_type operator()(registry_type &other) const ENTT_NOEXCEPT { + entity_type operator()(registry_type &other) const ENTT_NOEXCEPT { return create(other); } @@ -453,7 +453,7 @@ public: * * @return A valid entity identifier. */ - inline entity_type operator()() const ENTT_NOEXCEPT { + entity_type operator()() const ENTT_NOEXCEPT { return create(*reg); } @@ -461,12 +461,12 @@ public: * @brief Returns a reference to the underlying registry. * @return A reference to the underlying registry. */ - inline const registry_type & backend() const ENTT_NOEXCEPT { + const registry_type & backend() const ENTT_NOEXCEPT { return *reg; } /*! @copydoc backend */ - inline registry_type & backend() ENTT_NOEXCEPT { + registry_type & backend() ENTT_NOEXCEPT { return const_cast(std::as_const(*this).backend()); } diff --git a/src/entt/entity/registry.hpp b/src/entt/entity/registry.hpp index 673239394..7ed1c0cbf 100644 --- a/src/entt/entity/registry.hpp +++ b/src/entt/entity/registry.hpp @@ -239,7 +239,7 @@ class basic_registry { } template - inline const auto * pool() const ENTT_NOEXCEPT { + const auto * pool() const ENTT_NOEXCEPT { const auto ctype = type(); if constexpr(is_named_type_v) { @@ -254,7 +254,7 @@ class basic_registry { } template - inline auto * pool() ENTT_NOEXCEPT { + auto * pool() ENTT_NOEXCEPT { return const_cast *>(std::as_const(*this).template pool()); } @@ -331,7 +331,7 @@ public: * @return Runtime numeric identifier of the given type of component. */ template - inline static component_type type() ENTT_NOEXCEPT { + static component_type type() ENTT_NOEXCEPT { return runtime_type(); } @@ -463,7 +463,7 @@ public: /*! @copydoc raw */ template - inline Component * raw() ENTT_NOEXCEPT { + Component * raw() ENTT_NOEXCEPT { return const_cast(std::as_const(*this).template raw()); } @@ -779,7 +779,7 @@ public: /*! @copydoc get */ template - inline decltype(auto) get([[maybe_unused]] const entity_type entity) ENTT_NOEXCEPT { + decltype(auto) get([[maybe_unused]] const entity_type entity) ENTT_NOEXCEPT { ENTT_ASSERT(valid(entity)); if constexpr(sizeof...(Component) == 1) { @@ -846,7 +846,7 @@ public: /*! @copydoc try_get */ template - inline auto try_get([[maybe_unused]] const entity_type entity) ENTT_NOEXCEPT { + auto try_get([[maybe_unused]] const entity_type entity) ENTT_NOEXCEPT { if constexpr(sizeof...(Component) == 1) { return (const_cast(std::as_const(*this).template try_get(entity)), ...); } else { @@ -1276,7 +1276,7 @@ public: /*! @copydoc view */ template - inline entt::basic_view view() const { + entt::basic_view view() const { static_assert(std::conjunction_v...>); return const_cast(this)->view(); } @@ -1320,7 +1320,7 @@ public: * @return A newly created group. */ template - inline entt::basic_group, Owned...> group(get_t, exclude_t = {}) { + entt::basic_group, Owned...> group(get_t, exclude_t = {}) { static_assert(sizeof...(Owned) + sizeof...(Get) > 0); static_assert(sizeof...(Owned) + sizeof...(Get) + sizeof...(Exclude) > 1); @@ -1395,20 +1395,20 @@ public: /*! @copydoc group */ template - inline entt::basic_group, Owned...> group(get_t, exclude_t = {}) const { + entt::basic_group, Owned...> group(get_t, exclude_t = {}) const { static_assert(std::conjunction_v..., std::is_const...>); return const_cast(this)->group(entt::get, exclude); } /*! @copydoc group */ template - inline entt::basic_group, Owned...> group(exclude_t = {}) { + entt::basic_group, Owned...> group(exclude_t = {}) { return group(entt::get<>, exclude); } /*! @copydoc group */ template - inline entt::basic_group, Owned...> group(exclude_t = {}) const { + entt::basic_group, Owned...> group(exclude_t = {}) const { static_assert(std::conjunction_v...>); return const_cast(this)->group(exclude); } @@ -1653,7 +1653,7 @@ public: /*! @copydoc try_ctx */ template - inline Type * try_ctx() ENTT_NOEXCEPT { + Type * try_ctx() ENTT_NOEXCEPT { return const_cast(std::as_const(*this).template try_ctx()); } @@ -1678,7 +1678,7 @@ public: /*! @copydoc ctx */ template - inline Type & ctx() ENTT_NOEXCEPT { + Type & ctx() ENTT_NOEXCEPT { return const_cast(std::as_const(*this).template ctx()); } diff --git a/src/entt/entity/runtime_view.hpp b/src/entt/entity/runtime_view.hpp index 8507c8104..5bafae330 100644 --- a/src/entt/entity/runtime_view.hpp +++ b/src/entt/entity/runtime_view.hpp @@ -108,7 +108,7 @@ class basic_runtime_view { return other.begin == begin; } - inline bool operator!=(const iterator &other) const ENTT_NOEXCEPT { + bool operator!=(const iterator &other) const ENTT_NOEXCEPT { return !(*this == other); } @@ -116,7 +116,7 @@ class basic_runtime_view { return begin.operator->(); } - inline reference operator*() const ENTT_NOEXCEPT { + reference operator*() const ENTT_NOEXCEPT { return *operator->(); } @@ -153,7 +153,7 @@ class basic_runtime_view { return extent; } - inline bool valid() const ENTT_NOEXCEPT { + bool valid() const ENTT_NOEXCEPT { return !pools.empty() && pools.front(); } diff --git a/src/entt/entity/sparse_set.hpp b/src/entt/entity/sparse_set.hpp index aee9baea8..640a1c07d 100644 --- a/src/entt/entity/sparse_set.hpp +++ b/src/entt/entity/sparse_set.hpp @@ -95,11 +95,11 @@ class sparse_set { return iterator{direct, index-value}; } - inline iterator & operator-=(const difference_type value) ENTT_NOEXCEPT { + iterator & operator-=(const difference_type value) ENTT_NOEXCEPT { return (*this += -value); } - inline iterator operator-(const difference_type value) const ENTT_NOEXCEPT { + iterator operator-(const difference_type value) const ENTT_NOEXCEPT { return (*this + -value); } @@ -116,7 +116,7 @@ class sparse_set { return other.index == index; } - inline bool operator!=(const iterator &other) const ENTT_NOEXCEPT { + bool operator!=(const iterator &other) const ENTT_NOEXCEPT { return !(*this == other); } @@ -128,11 +128,11 @@ class sparse_set { return index < other.index; } - inline bool operator<=(const iterator &other) const ENTT_NOEXCEPT { + bool operator<=(const iterator &other) const ENTT_NOEXCEPT { return !(*this > other); } - inline bool operator>=(const iterator &other) const ENTT_NOEXCEPT { + bool operator>=(const iterator &other) const ENTT_NOEXCEPT { return !(*this < other); } @@ -141,7 +141,7 @@ class sparse_set { return &(*direct)[pos]; } - inline reference operator*() const ENTT_NOEXCEPT { + reference operator*() const ENTT_NOEXCEPT { return *operator->(); } diff --git a/src/entt/entity/storage.hpp b/src/entt/entity/storage.hpp index 911a7313b..abc763e88 100644 --- a/src/entt/entity/storage.hpp +++ b/src/entt/entity/storage.hpp @@ -98,11 +98,11 @@ class basic_storage: public sparse_set { return iterator{instances, index-value}; } - inline iterator & operator-=(const difference_type value) ENTT_NOEXCEPT { + iterator & operator-=(const difference_type value) ENTT_NOEXCEPT { return (*this += -value); } - inline iterator operator-(const difference_type value) const ENTT_NOEXCEPT { + iterator operator-(const difference_type value) const ENTT_NOEXCEPT { return (*this + -value); } @@ -119,7 +119,7 @@ class basic_storage: public sparse_set { return other.index == index; } - inline bool operator!=(const iterator &other) const ENTT_NOEXCEPT { + bool operator!=(const iterator &other) const ENTT_NOEXCEPT { return !(*this == other); } @@ -131,11 +131,11 @@ class basic_storage: public sparse_set { return index < other.index; } - inline bool operator<=(const iterator &other) const ENTT_NOEXCEPT { + bool operator<=(const iterator &other) const ENTT_NOEXCEPT { return !(*this > other); } - inline bool operator>=(const iterator &other) const ENTT_NOEXCEPT { + bool operator>=(const iterator &other) const ENTT_NOEXCEPT { return !(*this < other); } @@ -144,7 +144,7 @@ class basic_storage: public sparse_set { return &(*instances)[pos]; } - inline reference operator*() const ENTT_NOEXCEPT { + reference operator*() const ENTT_NOEXCEPT { return *operator->(); } @@ -226,7 +226,7 @@ public: } /*! @copydoc cbegin */ - inline const_iterator_type begin() const ENTT_NOEXCEPT { + const_iterator_type begin() const ENTT_NOEXCEPT { return cbegin(); } @@ -255,7 +255,7 @@ public: } /*! @copydoc cend */ - inline const_iterator_type end() const ENTT_NOEXCEPT { + const_iterator_type end() const ENTT_NOEXCEPT { return cend(); } @@ -281,7 +281,7 @@ public: } /*! @copydoc get */ - inline object_type & get(const entity_type entt) ENTT_NOEXCEPT { + object_type & get(const entity_type entt) ENTT_NOEXCEPT { return const_cast(std::as_const(*this).get(entt)); } @@ -295,7 +295,7 @@ public: } /*! @copydoc try_get */ - inline object_type * try_get(const entity_type entt) ENTT_NOEXCEPT { + object_type * try_get(const entity_type entt) ENTT_NOEXCEPT { return const_cast(std::as_const(*this).try_get(entt)); } @@ -577,11 +577,11 @@ class basic_storage>>: publ return iterator{index-value}; } - inline iterator & operator-=(const difference_type value) ENTT_NOEXCEPT { + iterator & operator-=(const difference_type value) ENTT_NOEXCEPT { return (*this += -value); } - inline iterator operator-(const difference_type value) const ENTT_NOEXCEPT { + iterator operator-(const difference_type value) const ENTT_NOEXCEPT { return (*this + -value); } @@ -597,7 +597,7 @@ class basic_storage>>: publ return other.index == index; } - inline bool operator!=(const iterator &other) const ENTT_NOEXCEPT { + bool operator!=(const iterator &other) const ENTT_NOEXCEPT { return !(*this == other); } @@ -609,11 +609,11 @@ class basic_storage>>: publ return index < other.index; } - inline bool operator<=(const iterator &other) const ENTT_NOEXCEPT { + bool operator<=(const iterator &other) const ENTT_NOEXCEPT { return !(*this > other); } - inline bool operator>=(const iterator &other) const ENTT_NOEXCEPT { + bool operator>=(const iterator &other) const ENTT_NOEXCEPT { return !(*this < other); } @@ -621,7 +621,7 @@ class basic_storage>>: publ return nullptr; } - inline reference operator*() const ENTT_NOEXCEPT { + reference operator*() const ENTT_NOEXCEPT { return {}; } @@ -657,7 +657,7 @@ public: } /*! @copydoc cbegin */ - inline iterator_type begin() const ENTT_NOEXCEPT { + iterator_type begin() const ENTT_NOEXCEPT { return cbegin(); } @@ -680,7 +680,7 @@ public: } /*! @copydoc cend */ - inline iterator_type end() const ENTT_NOEXCEPT { + iterator_type end() const ENTT_NOEXCEPT { return cend(); } diff --git a/src/entt/entity/view.hpp b/src/entt/entity/view.hpp index b3d51da36..5ba0a890a 100644 --- a/src/entt/entity/view.hpp +++ b/src/entt/entity/view.hpp @@ -124,7 +124,7 @@ class basic_view { return other.begin == begin; } - inline bool operator!=(const iterator &other) const ENTT_NOEXCEPT { + bool operator!=(const iterator &other) const ENTT_NOEXCEPT { return !(*this == other); } @@ -132,7 +132,7 @@ class basic_view { return begin.operator->(); } - inline reference operator*() const ENTT_NOEXCEPT { + reference operator*() const ENTT_NOEXCEPT { return *operator->(); } @@ -162,7 +162,7 @@ class basic_view { } template - inline decltype(auto) get([[maybe_unused]] component_iterator_type it, [[maybe_unused]] pool_type *cpool, [[maybe_unused]] const Entity entt) const ENTT_NOEXCEPT { + decltype(auto) get([[maybe_unused]] component_iterator_type it, [[maybe_unused]] pool_type *cpool, [[maybe_unused]] const Entity entt) const ENTT_NOEXCEPT { if constexpr(std::is_same_v) { return *it; } else { @@ -395,7 +395,7 @@ public: * @param func A valid function object. */ template - inline void each(Func func) const { + void each(Func func) const { const auto *view = candidate(); ((std::get *>(pools) == view ? each(std::move(func)) : void()), ...); } @@ -431,7 +431,7 @@ public: * @param func A valid function object. */ template - inline void each(Func func) const { + void each(Func func) const { using other_type = type_list_cat_t, type_list<>, type_list>...>; traverse(std::move(func), other_type{}, type_list{}); } @@ -457,7 +457,7 @@ public: * @param func A valid function object. */ template - inline void less(Func func) const { + void less(Func func) const { const auto *view = candidate(); ((std::get *>(pools) == view ? less(std::move(func)) : void()), ...); } @@ -490,7 +490,7 @@ public: * @param func A valid function object. */ template - inline void less(Func func) const { + void less(Func func) const { using other_type = type_list_cat_t, type_list<>, type_list>...>; using non_empty_type = type_list_cat_t, type_list<>, type_list>...>; traverse(std::move(func), other_type{}, non_empty_type{}); @@ -713,7 +713,7 @@ public: * @param func A valid function object. */ template - inline void each(Func func) const { + void each(Func func) const { if constexpr(std::is_invocable_v) { std::for_each(pool->begin(), pool->end(), std::move(func)); } else { @@ -752,7 +752,7 @@ public: * @param func A valid function object. */ template - inline void less(Func func) const { + void less(Func func) const { if constexpr(std::is_empty_v) { if constexpr(std::is_invocable_v) { for(auto pos = pool->size(); pos; --pos) { diff --git a/src/entt/locator/locator.hpp b/src/entt/locator/locator.hpp index 8d529f903..b311a6d77 100644 --- a/src/entt/locator/locator.hpp +++ b/src/entt/locator/locator.hpp @@ -35,7 +35,7 @@ struct service_locator { * @brief Tests if a valid service implementation is set. * @return True if the service is set, false otherwise. */ - inline static bool empty() ENTT_NOEXCEPT { + static bool empty() ENTT_NOEXCEPT { return !static_cast(service); } @@ -49,7 +49,7 @@ struct service_locator { * * @return A reference to the service implementation currently set, if any. */ - inline static std::weak_ptr get() ENTT_NOEXCEPT { + static std::weak_ptr get() ENTT_NOEXCEPT { return service; } @@ -67,7 +67,7 @@ struct service_locator { * * @return A reference to the service implementation currently set, if any. */ - inline static Service & ref() ENTT_NOEXCEPT { + static Service & ref() ENTT_NOEXCEPT { return *service; } @@ -78,7 +78,7 @@ struct service_locator { * @param args Parameters to use to construct the service. */ template - inline static void set(Args &&... args) { + static void set(Args &&... args) { service = std::make_shared(std::forward(args)...); } @@ -86,7 +86,7 @@ struct service_locator { * @brief Sets or replaces a service. * @param ptr Service to use to replace the current one. */ - inline static void set(std::shared_ptr ptr) { + static void set(std::shared_ptr ptr) { ENTT_ASSERT(static_cast(ptr)); service = std::move(ptr); } @@ -96,7 +96,7 @@ struct service_locator { * * The service is no longer valid after a reset. */ - inline static void reset() { + static void reset() { service.reset(); } diff --git a/src/entt/meta/factory.hpp b/src/entt/meta/factory.hpp index bd82d3b5f..bd853d288 100644 --- a/src/entt/meta/factory.hpp +++ b/src/entt/meta/factory.hpp @@ -40,11 +40,11 @@ class meta_factory { static_assert(std::is_object_v && !(std::is_const_v || std::is_volatile_v)); template - inline bool duplicate(const hashed_string &name, const Node *node) ENTT_NOEXCEPT { + bool duplicate(const hashed_string &name, const Node *node) ENTT_NOEXCEPT { return node ? node->name == name || duplicate(name, node->next) : false; } - inline bool duplicate(const meta_any &key, const internal::meta_prop_node *node) ENTT_NOEXCEPT { + bool duplicate(const meta_any &key, const internal::meta_prop_node *node) ENTT_NOEXCEPT { return node ? node->key() == key || duplicate(key, node->next) : false; } @@ -674,7 +674,7 @@ inline meta_type resolve(const char *str) ENTT_NOEXCEPT { * @param op A valid function object. */ template -void resolve(Op op) ENTT_NOEXCEPT { +inline void resolve(Op op) ENTT_NOEXCEPT { internal::iterate([op = std::move(op)](auto *node) { op(node->meta()); }, internal::meta_info<>::type); diff --git a/src/entt/meta/meta.hpp b/src/entt/meta/meta.hpp index ddaebcd01..b4545f2f3 100644 --- a/src/entt/meta/meta.hpp +++ b/src/entt/meta/meta.hpp @@ -142,12 +142,12 @@ struct meta_type_node { meta_type(* const remove_pointer)(); bool(* const destroy)(meta_handle); meta_type(* const meta)(); - meta_base_node *base; - meta_conv_node *conv; - meta_ctor_node *ctor; - meta_dtor_node *dtor; - meta_data_node *data; - meta_func_node *func; + meta_base_node *base{nullptr}; + meta_conv_node *conv{nullptr}; + meta_ctor_node *ctor{nullptr}; + meta_dtor_node *dtor{nullptr}; + meta_data_node *data{nullptr}; + meta_func_node *func{nullptr}; }; @@ -309,13 +309,13 @@ class meta_any { using destroy_fn_type = void(*)(storage_type &); template - inline static auto compare(int, const Type &lhs, const Type &rhs) + static auto compare(int, const Type &lhs, const Type &rhs) -> decltype(lhs == rhs, bool{}) { return lhs == rhs; } template - inline static bool compare(char, const Type &lhs, const Type &rhs) { + static bool compare(char, const Type &lhs, const Type &rhs) { return &lhs == &rhs; } @@ -459,12 +459,12 @@ public: * @brief Returns an opaque pointer to the contained instance. * @return An opaque pointer the contained instance, if any. */ - inline const void * data() const ENTT_NOEXCEPT { + const void * data() const ENTT_NOEXCEPT { return instance; } /*! @copydoc data */ - inline void * data() ENTT_NOEXCEPT { + void * data() ENTT_NOEXCEPT { return const_cast(std::as_const(*this).data()); } @@ -474,7 +474,7 @@ public: * @return True if the cast is viable, false otherwise. */ template - inline bool can_cast() const ENTT_NOEXCEPT { + bool can_cast() const ENTT_NOEXCEPT { const auto *type = internal::meta_info::resolve(); return internal::can_cast_or_convert<&internal::meta_type_node::base>(node, type); } @@ -494,14 +494,14 @@ public: * @return A reference to the contained instance. */ template - inline const Type & cast() const ENTT_NOEXCEPT { + const Type & cast() const ENTT_NOEXCEPT { ENTT_ASSERT(can_cast()); return *internal::try_cast(node, instance); } /*! @copydoc cast */ template - inline Type & cast() ENTT_NOEXCEPT { + Type & cast() ENTT_NOEXCEPT { return const_cast(std::as_const(*this).cast()); } @@ -511,7 +511,7 @@ public: * @return True if the conversion is viable, false otherwise. */ template - inline bool can_convert() const ENTT_NOEXCEPT { + bool can_convert() const ENTT_NOEXCEPT { const auto *type = internal::meta_info::resolve(); return internal::can_cast_or_convert<&internal::meta_type_node::conv>(node, type); } @@ -523,7 +523,7 @@ public: * one otherwise. */ template - inline meta_any convert() const ENTT_NOEXCEPT { + meta_any convert() const ENTT_NOEXCEPT { const auto *type = internal::meta_info::resolve(); meta_any any{}; @@ -548,7 +548,7 @@ public: * @return True if the conversion is possible, false otherwise. */ template - inline bool convert() ENTT_NOEXCEPT { + bool convert() ENTT_NOEXCEPT { bool valid = (node == internal::meta_info::resolve()); if(!valid) { @@ -567,7 +567,7 @@ public: * @brief Returns false if a container is empty, true otherwise. * @return False if the container is empty, true otherwise. */ - inline explicit operator bool() const ENTT_NOEXCEPT { + explicit operator bool() const ENTT_NOEXCEPT { return destroy_fn; } @@ -577,7 +577,7 @@ public: * @return False if the two containers differ in their content, true * otherwise. */ - inline bool operator==(const meta_any &other) const ENTT_NOEXCEPT { + bool operator==(const meta_any &other) const ENTT_NOEXCEPT { return (!instance && !other.instance) || (instance && other.instance && node == other.node && compare_fn(instance, other.instance)); } @@ -683,13 +683,13 @@ public: * @return A pointer to the contained instance. */ template - inline const Type * try_cast() const ENTT_NOEXCEPT { + const Type * try_cast() const ENTT_NOEXCEPT { return internal::try_cast(node, instance); } /*! @copydoc try_cast */ template - inline Type * try_cast() ENTT_NOEXCEPT { + Type * try_cast() ENTT_NOEXCEPT { return const_cast(std::as_const(*this).try_cast()); } @@ -697,12 +697,12 @@ public: * @brief Returns an opaque pointer to the contained instance. * @return An opaque pointer the contained instance, if any. */ - inline const void * data() const ENTT_NOEXCEPT { + const void * data() const ENTT_NOEXCEPT { return instance; } /*! @copydoc data */ - inline void * data() ENTT_NOEXCEPT { + void * data() ENTT_NOEXCEPT { return const_cast(std::as_const(*this).data()); } @@ -710,7 +710,7 @@ public: * @brief Returns false if a handle is empty, true otherwise. * @return False if the handle is empty, true otherwise. */ - inline explicit operator bool() const ENTT_NOEXCEPT { + explicit operator bool() const ENTT_NOEXCEPT { return instance; } @@ -741,13 +741,13 @@ class meta_prop { /*! @brief A meta factory is allowed to create meta objects. */ template friend class meta_factory; - inline meta_prop(const internal::meta_prop_node *curr) ENTT_NOEXCEPT + meta_prop(const internal::meta_prop_node *curr) ENTT_NOEXCEPT : node{curr} {} public: /*! @brief Default constructor. */ - inline meta_prop() ENTT_NOEXCEPT + meta_prop() ENTT_NOEXCEPT : node{nullptr} {} @@ -755,7 +755,7 @@ public: * @brief Returns the stored key. * @return A meta any containing the key stored with the given property. */ - inline meta_any key() const ENTT_NOEXCEPT { + meta_any key() const ENTT_NOEXCEPT { return node->key(); } @@ -763,7 +763,7 @@ public: * @brief Returns the stored value. * @return A meta any containing the value stored with the given property. */ - inline meta_any value() const ENTT_NOEXCEPT { + meta_any value() const ENTT_NOEXCEPT { return node->value(); } @@ -771,7 +771,7 @@ public: * @brief Returns true if a meta object is valid, false otherwise. * @return True if the meta object is valid, false otherwise. */ - inline explicit operator bool() const ENTT_NOEXCEPT { + explicit operator bool() const ENTT_NOEXCEPT { return node; } @@ -781,7 +781,7 @@ public: * @return True if the two meta objects refer to the same node, false * otherwise. */ - inline bool operator==(const meta_prop &other) const ENTT_NOEXCEPT { + bool operator==(const meta_prop &other) const ENTT_NOEXCEPT { return node == other.node; } @@ -811,13 +811,13 @@ class meta_base { /*! @brief A meta factory is allowed to create meta objects. */ template friend class meta_factory; - inline meta_base(const internal::meta_base_node *curr) ENTT_NOEXCEPT + meta_base(const internal::meta_base_node *curr) ENTT_NOEXCEPT : node{curr} {} public: /*! @brief Default constructor. */ - inline meta_base() ENTT_NOEXCEPT + meta_base() ENTT_NOEXCEPT : node{nullptr} {} @@ -838,7 +838,7 @@ public: * @param instance The instance to cast. * @return An opaque pointer to the base type. */ - inline void * cast(void *instance) const ENTT_NOEXCEPT { + void * cast(void *instance) const ENTT_NOEXCEPT { return node->cast(instance); } @@ -846,7 +846,7 @@ public: * @brief Returns true if a meta object is valid, false otherwise. * @return True if the meta object is valid, false otherwise. */ - inline explicit operator bool() const ENTT_NOEXCEPT { + explicit operator bool() const ENTT_NOEXCEPT { return node; } @@ -856,7 +856,7 @@ public: * @return True if the two meta objects refer to the same node, false * otherwise. */ - inline bool operator==(const meta_base &other) const ENTT_NOEXCEPT { + bool operator==(const meta_base &other) const ENTT_NOEXCEPT { return node == other.node; } @@ -886,13 +886,13 @@ class meta_conv { /*! @brief A meta factory is allowed to create meta objects. */ template friend class meta_factory; - inline meta_conv(const internal::meta_conv_node *curr) ENTT_NOEXCEPT + meta_conv(const internal::meta_conv_node *curr) ENTT_NOEXCEPT : node{curr} {} public: /*! @brief Default constructor. */ - inline meta_conv() ENTT_NOEXCEPT + meta_conv() ENTT_NOEXCEPT : node{nullptr} {} @@ -913,7 +913,7 @@ public: * @param instance The instance to convert. * @return An opaque pointer to the instance to convert. */ - inline meta_any convert(void *instance) const ENTT_NOEXCEPT { + meta_any convert(void *instance) const ENTT_NOEXCEPT { return node->conv(instance); } @@ -921,7 +921,7 @@ public: * @brief Returns true if a meta object is valid, false otherwise. * @return True if the meta object is valid, false otherwise. */ - inline explicit operator bool() const ENTT_NOEXCEPT { + explicit operator bool() const ENTT_NOEXCEPT { return node; } @@ -931,7 +931,7 @@ public: * @return True if the two meta objects refer to the same node, false * otherwise. */ - inline bool operator==(const meta_conv &other) const ENTT_NOEXCEPT { + bool operator==(const meta_conv &other) const ENTT_NOEXCEPT { return node == other.node; } @@ -961,7 +961,7 @@ class meta_ctor { /*! @brief A meta factory is allowed to create meta objects. */ template friend class meta_factory; - inline meta_ctor(const internal::meta_ctor_node *curr) ENTT_NOEXCEPT + meta_ctor(const internal::meta_ctor_node *curr) ENTT_NOEXCEPT : node{curr} {} @@ -970,7 +970,7 @@ public: using size_type = typename internal::meta_ctor_node::size_type; /*! @brief Default constructor. */ - inline meta_ctor() ENTT_NOEXCEPT + meta_ctor() ENTT_NOEXCEPT : node{nullptr} {} @@ -984,7 +984,7 @@ public: * @brief Returns the number of arguments accepted by a meta constructor. * @return The number of arguments accepted by the meta constructor. */ - inline size_type size() const ENTT_NOEXCEPT { + size_type size() const ENTT_NOEXCEPT { return node->size; } @@ -993,7 +993,7 @@ public: * @param index The index of the argument of which to return the meta type. * @return The meta type of the i-th argument of a meta constructor, if any. */ - inline meta_type arg(size_type index) const ENTT_NOEXCEPT; + meta_type arg(size_type index) const ENTT_NOEXCEPT; /** * @brief Creates an instance of the underlying type, if possible. @@ -1024,7 +1024,7 @@ public: * @param op A valid function object. */ template - inline std::enable_if_t, void> + std::enable_if_t, void> prop(Op op) const ENTT_NOEXCEPT { internal::iterate([op = std::move(op)](auto *curr) { op(curr->meta()); @@ -1038,7 +1038,7 @@ public: * @return The property associated with the given key, if any. */ template - inline std::enable_if_t, meta_prop> + std::enable_if_t, meta_prop> prop(Key &&key) const ENTT_NOEXCEPT { const auto *curr = internal::find_if([key = meta_any{std::forward(key)}](auto *candidate) { return candidate->key() == key; @@ -1051,7 +1051,7 @@ public: * @brief Returns true if a meta object is valid, false otherwise. * @return True if the meta object is valid, false otherwise. */ - inline explicit operator bool() const ENTT_NOEXCEPT { + explicit operator bool() const ENTT_NOEXCEPT { return node; } @@ -1061,7 +1061,7 @@ public: * @return True if the two meta objects refer to the same node, false * otherwise. */ - inline bool operator==(const meta_ctor &other) const ENTT_NOEXCEPT { + bool operator==(const meta_ctor &other) const ENTT_NOEXCEPT { return node == other.node; } @@ -1091,13 +1091,13 @@ class meta_dtor { /*! @brief A meta factory is allowed to create meta objects. */ template friend class meta_factory; - inline meta_dtor(const internal::meta_dtor_node *curr) ENTT_NOEXCEPT + meta_dtor(const internal::meta_dtor_node *curr) ENTT_NOEXCEPT : node{curr} {} public: /*! @brief Default constructor. */ - inline meta_dtor() ENTT_NOEXCEPT + meta_dtor() ENTT_NOEXCEPT : node{nullptr} {} @@ -1117,7 +1117,7 @@ public: * @param handle An opaque pointer to an instance of the underlying type. * @return True in case of success, false otherwise. */ - inline bool invoke(meta_handle handle) const { + bool invoke(meta_handle handle) const { return node->invoke(handle); } @@ -1125,7 +1125,7 @@ public: * @brief Returns true if a meta object is valid, false otherwise. * @return True if the meta object is valid, false otherwise. */ - inline explicit operator bool() const ENTT_NOEXCEPT { + explicit operator bool() const ENTT_NOEXCEPT { return node; } @@ -1135,7 +1135,7 @@ public: * @return True if the two meta objects refer to the same node, false * otherwise. */ - inline bool operator==(const meta_dtor &other) const ENTT_NOEXCEPT { + bool operator==(const meta_dtor &other) const ENTT_NOEXCEPT { return node == other.node; } @@ -1165,13 +1165,13 @@ class meta_data { /*! @brief A meta factory is allowed to create meta objects. */ template friend class meta_factory; - inline meta_data(const internal::meta_data_node *curr) ENTT_NOEXCEPT + meta_data(const internal::meta_data_node *curr) ENTT_NOEXCEPT : node{curr} {} public: /*! @brief Default constructor. */ - inline meta_data() ENTT_NOEXCEPT + meta_data() ENTT_NOEXCEPT : node{nullptr} {} @@ -1179,7 +1179,7 @@ public: * @brief Returns the name assigned to a given meta data. * @return The name assigned to the meta data. */ - inline const char * name() const ENTT_NOEXCEPT { + const char * name() const ENTT_NOEXCEPT { return node->name; } @@ -1193,7 +1193,7 @@ public: * @brief Indicates whether a given meta data is constant or not. * @return True if the meta data is constant, false otherwise. */ - inline bool is_const() const ENTT_NOEXCEPT { + bool is_const() const ENTT_NOEXCEPT { return node->is_const; } @@ -1205,7 +1205,7 @@ public: * * @return True if the meta data is static, false otherwise. */ - inline bool is_static() const ENTT_NOEXCEPT { + bool is_static() const ENTT_NOEXCEPT { return node->is_static; } @@ -1230,7 +1230,7 @@ public: * @return True in case of success, false otherwise. */ template - inline bool set(meta_handle handle, Type &&value) const { + bool set(meta_handle handle, Type &&value) const { return node->set(handle, meta_any{}, std::forward(value)); } @@ -1250,7 +1250,7 @@ public: * @return True in case of success, false otherwise. */ template - inline bool set(meta_handle handle, std::size_t index, Type &&value) const { + bool set(meta_handle handle, std::size_t index, Type &&value) const { ENTT_ASSERT(index < node->type()->extent); return node->set(handle, index, std::forward(value)); } @@ -1264,7 +1264,7 @@ public: * @param handle An opaque pointer to an instance of the underlying type. * @return A meta any containing the value of the underlying variable. */ - inline meta_any get(meta_handle handle) const ENTT_NOEXCEPT { + meta_any get(meta_handle handle) const ENTT_NOEXCEPT { return node->get(handle, meta_any{}); } @@ -1278,7 +1278,7 @@ public: * @param index Position of the underlying element to get. * @return A meta any containing the value of the underlying element. */ - inline meta_any get(meta_handle handle, std::size_t index) const ENTT_NOEXCEPT { + meta_any get(meta_handle handle, std::size_t index) const ENTT_NOEXCEPT { ENTT_ASSERT(index < node->type()->extent); return node->get(handle, index); } @@ -1289,7 +1289,7 @@ public: * @param op A valid function object. */ template - inline std::enable_if_t, void> + std::enable_if_t, void> prop(Op op) const ENTT_NOEXCEPT { internal::iterate([op = std::move(op)](auto *curr) { op(curr->meta()); @@ -1303,7 +1303,7 @@ public: * @return The property associated with the given key, if any. */ template - inline std::enable_if_t, meta_prop> + std::enable_if_t, meta_prop> prop(Key &&key) const ENTT_NOEXCEPT { const auto *curr = internal::find_if([key = meta_any{std::forward(key)}](auto *candidate) { return candidate->key() == key; @@ -1316,7 +1316,7 @@ public: * @brief Returns true if a meta object is valid, false otherwise. * @return True if the meta object is valid, false otherwise. */ - inline explicit operator bool() const ENTT_NOEXCEPT { + explicit operator bool() const ENTT_NOEXCEPT { return node; } @@ -1326,7 +1326,7 @@ public: * @return True if the two meta objects refer to the same node, false * otherwise. */ - inline bool operator==(const meta_data &other) const ENTT_NOEXCEPT { + bool operator==(const meta_data &other) const ENTT_NOEXCEPT { return node == other.node; } @@ -1356,7 +1356,7 @@ class meta_func { /*! @brief A meta factory is allowed to create meta objects. */ template friend class meta_factory; - inline meta_func(const internal::meta_func_node *curr) ENTT_NOEXCEPT + meta_func(const internal::meta_func_node *curr) ENTT_NOEXCEPT : node{curr} {} @@ -1365,7 +1365,7 @@ public: using size_type = typename internal::meta_func_node::size_type; /*! @brief Default constructor. */ - inline meta_func() ENTT_NOEXCEPT + meta_func() ENTT_NOEXCEPT : node{nullptr} {} @@ -1373,7 +1373,7 @@ public: * @brief Returns the name assigned to a given meta function. * @return The name assigned to the meta function. */ - inline const char * name() const ENTT_NOEXCEPT { + const char * name() const ENTT_NOEXCEPT { return node->name; } @@ -1387,7 +1387,7 @@ public: * @brief Returns the number of arguments accepted by a meta function. * @return The number of arguments accepted by the meta function. */ - inline size_type size() const ENTT_NOEXCEPT { + size_type size() const ENTT_NOEXCEPT { return node->size; } @@ -1395,7 +1395,7 @@ public: * @brief Indicates whether a given meta function is constant or not. * @return True if the meta function is constant, false otherwise. */ - inline bool is_const() const ENTT_NOEXCEPT { + bool is_const() const ENTT_NOEXCEPT { return node->is_const; } @@ -1407,7 +1407,7 @@ public: * * @return True if the meta function is static, false otherwise. */ - inline bool is_static() const ENTT_NOEXCEPT { + bool is_static() const ENTT_NOEXCEPT { return node->is_static; } @@ -1457,7 +1457,7 @@ public: * @param op A valid function object. */ template - inline std::enable_if_t, void> + std::enable_if_t, void> prop(Op op) const ENTT_NOEXCEPT { internal::iterate([op = std::move(op)](auto *curr) { op(curr->meta()); @@ -1471,7 +1471,7 @@ public: * @return The property associated with the given key, if any. */ template - inline std::enable_if_t, meta_prop> + std::enable_if_t, meta_prop> prop(Key &&key) const ENTT_NOEXCEPT { const auto *curr = internal::find_if([key = meta_any{std::forward(key)}](auto *candidate) { return candidate->key() == key; @@ -1484,7 +1484,7 @@ public: * @brief Returns true if a meta object is valid, false otherwise. * @return True if the meta object is valid, false otherwise. */ - inline explicit operator bool() const ENTT_NOEXCEPT { + explicit operator bool() const ENTT_NOEXCEPT { return node; } @@ -1494,7 +1494,7 @@ public: * @return True if the two meta objects refer to the same node, false * otherwise. */ - inline bool operator==(const meta_func &other) const ENTT_NOEXCEPT { + bool operator==(const meta_func &other) const ENTT_NOEXCEPT { return node == other.node; } @@ -1527,7 +1527,7 @@ class meta_type { /*! @brief A meta node is allowed to create meta objects. */ template friend struct internal::meta_node; - inline meta_type(const internal::meta_type_node *curr) ENTT_NOEXCEPT + meta_type(const internal::meta_type_node *curr) ENTT_NOEXCEPT : node{curr} {} @@ -1536,7 +1536,7 @@ public: using size_type = typename internal::meta_type_node::size_type; /*! @brief Default constructor. */ - inline meta_type() ENTT_NOEXCEPT + meta_type() ENTT_NOEXCEPT : node{nullptr} {} @@ -1544,7 +1544,7 @@ public: * @brief Returns the name assigned to a given meta type. * @return The name assigned to the meta type. */ - inline const char * name() const ENTT_NOEXCEPT { + const char * name() const ENTT_NOEXCEPT { return node->name; } @@ -1552,7 +1552,7 @@ public: * @brief Indicates whether a given meta type refers to void or not. * @return True if the underlying type is void, false otherwise. */ - inline bool is_void() const ENTT_NOEXCEPT { + bool is_void() const ENTT_NOEXCEPT { return node->is_void; } @@ -1561,7 +1561,7 @@ public: * not. * @return True if the underlying type is an integral type, false otherwise. */ - inline bool is_integral() const ENTT_NOEXCEPT { + bool is_integral() const ENTT_NOEXCEPT { return node->is_integral; } @@ -1571,7 +1571,7 @@ public: * @return True if the underlying type is a floating-point type, false * otherwise. */ - inline bool is_floating_point() const ENTT_NOEXCEPT { + bool is_floating_point() const ENTT_NOEXCEPT { return node->is_floating_point; } @@ -1580,7 +1580,7 @@ public: * not. * @return True if the underlying type is an array type, false otherwise. */ - inline bool is_array() const ENTT_NOEXCEPT { + bool is_array() const ENTT_NOEXCEPT { return node->is_array; } @@ -1588,7 +1588,7 @@ public: * @brief Indicates whether a given meta type refers to an enum or not. * @return True if the underlying type is an enum, false otherwise. */ - inline bool is_enum() const ENTT_NOEXCEPT { + bool is_enum() const ENTT_NOEXCEPT { return node->is_enum; } @@ -1596,7 +1596,7 @@ public: * @brief Indicates whether a given meta type refers to an union or not. * @return True if the underlying type is an union, false otherwise. */ - inline bool is_union() const ENTT_NOEXCEPT { + bool is_union() const ENTT_NOEXCEPT { return node->is_union; } @@ -1604,7 +1604,7 @@ public: * @brief Indicates whether a given meta type refers to a class or not. * @return True if the underlying type is a class, false otherwise. */ - inline bool is_class() const ENTT_NOEXCEPT { + bool is_class() const ENTT_NOEXCEPT { return node->is_class; } @@ -1612,7 +1612,7 @@ public: * @brief Indicates whether a given meta type refers to a pointer or not. * @return True if the underlying type is a pointer, false otherwise. */ - inline bool is_pointer() const ENTT_NOEXCEPT { + bool is_pointer() const ENTT_NOEXCEPT { return node->is_pointer; } @@ -1621,7 +1621,7 @@ public: * not. * @return True if the underlying type is a function, false otherwise. */ - inline bool is_function() const ENTT_NOEXCEPT { + bool is_function() const ENTT_NOEXCEPT { return node->is_function; } @@ -1631,7 +1631,7 @@ public: * @return True if the underlying type is a pointer to data member, false * otherwise. */ - inline bool is_member_object_pointer() const ENTT_NOEXCEPT { + bool is_member_object_pointer() const ENTT_NOEXCEPT { return node->is_member_object_pointer; } @@ -1641,7 +1641,7 @@ public: * @return True if the underlying type is a pointer to member function, * false otherwise. */ - inline bool is_member_function_pointer() const ENTT_NOEXCEPT { + bool is_member_function_pointer() const ENTT_NOEXCEPT { return node->is_member_function_pointer; } @@ -1651,7 +1651,7 @@ public: * @return The number of elements of the array if the underlying type is an * array type, 0 otherwise. */ - inline size_type extent() const ENTT_NOEXCEPT { + size_type extent() const ENTT_NOEXCEPT { return node->extent; } @@ -1660,7 +1660,7 @@ public: * @return The meta type for which the pointer is defined or this meta type * if it doesn't refer to a pointer type. */ - inline meta_type remove_pointer() const ENTT_NOEXCEPT { + meta_type remove_pointer() const ENTT_NOEXCEPT { return node->remove_pointer(); } @@ -1673,7 +1673,7 @@ public: * @param op A valid function object. */ template - inline void base(Op op) const ENTT_NOEXCEPT { + void base(Op op) const ENTT_NOEXCEPT { internal::iterate<&internal::meta_type_node::base>([op = std::move(op)](auto *curr) { op(curr->meta()); }, node); @@ -1687,7 +1687,7 @@ public: * @param str The name to use to search for a meta base. * @return The meta base associated with the given name, if any. */ - inline meta_base base(const char *str) const ENTT_NOEXCEPT { + meta_base base(const char *str) const ENTT_NOEXCEPT { const auto *curr = internal::find_if<&internal::meta_type_node::base>([name = hashed_string{str}](auto *candidate) { return candidate->type()->name == name; }, node); @@ -1705,7 +1705,7 @@ public: * @param op A valid function object. */ template - inline void conv(Op op) const ENTT_NOEXCEPT { + void conv(Op op) const ENTT_NOEXCEPT { internal::iterate<&internal::meta_type_node::conv>([op = std::move(op)](auto *curr) { op(curr->meta()); }, node); @@ -1722,7 +1722,7 @@ public: * any. */ template - inline meta_conv conv() const ENTT_NOEXCEPT { + meta_conv conv() const ENTT_NOEXCEPT { const auto *curr = internal::find_if<&internal::meta_type_node::conv>([type = internal::meta_info::resolve()](auto *candidate) { return candidate->type() == type; }, node); @@ -1736,7 +1736,7 @@ public: * @param op A valid function object. */ template - inline void ctor(Op op) const ENTT_NOEXCEPT { + void ctor(Op op) const ENTT_NOEXCEPT { internal::iterate([op = std::move(op)](auto *curr) { op(curr->meta()); }, node->ctor); @@ -1748,7 +1748,7 @@ public: * @return The requested meta constructor, if any. */ template - inline meta_ctor ctor() const ENTT_NOEXCEPT { + meta_ctor ctor() const ENTT_NOEXCEPT { const auto *curr = internal::ctor(std::make_index_sequence{}, node); return curr ? curr->meta() : meta_ctor{}; } @@ -1757,7 +1757,7 @@ public: * @brief Returns the meta destructor associated with a given type. * @return The meta destructor associated with the given type, if any. */ - inline meta_dtor dtor() const ENTT_NOEXCEPT { + meta_dtor dtor() const ENTT_NOEXCEPT { return node->dtor ? node->dtor->meta() : meta_dtor{}; } @@ -1771,7 +1771,7 @@ public: * @param op A valid function object. */ template - inline void data(Op op) const ENTT_NOEXCEPT { + void data(Op op) const ENTT_NOEXCEPT { internal::iterate<&internal::meta_type_node::data>([op = std::move(op)](auto *curr) { op(curr->meta()); }, node); @@ -1787,7 +1787,7 @@ public: * @param str The name to use to search for a meta data. * @return The meta data associated with the given name, if any. */ - inline meta_data data(const char *str) const ENTT_NOEXCEPT { + meta_data data(const char *str) const ENTT_NOEXCEPT { const auto *curr = internal::find_if<&internal::meta_type_node::data>([name = hashed_string{str}](auto *candidate) { return candidate->name == name; }, node); @@ -1806,7 +1806,7 @@ public: * @param op A valid function object. */ template - inline void func(Op op) const ENTT_NOEXCEPT { + void func(Op op) const ENTT_NOEXCEPT { internal::iterate<&internal::meta_type_node::func>([op = std::move(op)](auto *curr) { op(curr->meta()); }, node); @@ -1822,7 +1822,7 @@ public: * @param str The name to use to search for a meta function. * @return The meta function associated with the given name, if any. */ - inline meta_func func(const char *str) const ENTT_NOEXCEPT { + meta_func func(const char *str) const ENTT_NOEXCEPT { const auto *curr = internal::find_if<&internal::meta_type_node::func>([name = hashed_string{str}](auto *candidate) { return candidate->name == name; }, node); @@ -1863,7 +1863,7 @@ public: * @param handle An opaque pointer to an instance of the underlying type. * @return True in case of success, false otherwise. */ - inline bool destroy(meta_handle handle) const { + bool destroy(meta_handle handle) const { return node->dtor ? node->dtor->invoke(handle) : node->destroy(handle); } @@ -1877,7 +1877,7 @@ public: * @param op A valid function object. */ template - inline std::enable_if_t, void> + std::enable_if_t, void> prop(Op op) const ENTT_NOEXCEPT { internal::iterate<&internal::meta_type_node::prop>([op = std::move(op)](auto *curr) { op(curr->meta()); @@ -1896,7 +1896,7 @@ public: * @return The property associated with the given key, if any. */ template - inline std::enable_if_t, meta_prop> + std::enable_if_t, meta_prop> prop(Key &&key) const ENTT_NOEXCEPT { const auto *curr = internal::find_if<&internal::meta_type_node::prop>([key = meta_any{std::forward(key)}](auto *candidate) { return candidate->key() == key; @@ -1909,7 +1909,7 @@ public: * @brief Returns true if a meta object is valid, false otherwise. * @return True if the meta object is valid, false otherwise. */ - inline explicit operator bool() const ENTT_NOEXCEPT { + explicit operator bool() const ENTT_NOEXCEPT { return node; } @@ -1919,7 +1919,7 @@ public: * @return True if the two meta objects refer to the same node, false * otherwise. */ - inline bool operator==(const meta_type &other) const ENTT_NOEXCEPT { + bool operator==(const meta_type &other) const ENTT_NOEXCEPT { return node == other.node; } @@ -2032,7 +2032,7 @@ struct meta_function_helper { static constexpr auto size = sizeof...(Args); - inline static auto arg(typename internal::meta_func_node::size_type index) { + static auto arg(typename internal::meta_func_node::size_type index) { return std::array{{meta_info::resolve()...}}[index]; } }; @@ -2066,7 +2066,7 @@ struct meta_function_helper>: declt template -inline bool destroy([[maybe_unused]] meta_handle handle) { +bool destroy([[maybe_unused]] meta_handle handle) { bool accepted = false; if constexpr(std::is_object_v && !std::is_array_v) { @@ -2082,7 +2082,7 @@ inline bool destroy([[maybe_unused]] meta_handle handle) { template -inline meta_any construct(meta_any * const args, std::index_sequence) { +meta_any construct(meta_any * const args, std::index_sequence) { [[maybe_unused]] std::array can_cast{{(args+Indexes)->can_cast>>()...}}; [[maybe_unused]] std::array can_convert{{(std::get(can_cast) ? false : (args+Indexes)->can_convert>>())...}}; meta_any any{}; @@ -2156,7 +2156,7 @@ bool setter([[maybe_unused]] meta_handle handle, [[maybe_unused]] meta_any index template -inline meta_any getter([[maybe_unused]] meta_handle handle, [[maybe_unused]] meta_any index) { +meta_any getter([[maybe_unused]] meta_handle handle, [[maybe_unused]] meta_any index) { if constexpr(std::is_function_v> || std::is_member_function_pointer_v) { static_assert(std::is_invocable_v); auto *clazz = handle.try_cast(); @@ -2226,7 +2226,7 @@ invoke(meta_handle &handle, meta_any *args, std::index_sequence) { template -meta_type_node * meta_node::resolve() ENTT_NOEXCEPT { +inline meta_type_node * meta_node::resolve() ENTT_NOEXCEPT { if(!type) { static meta_type_node node{ {}, diff --git a/src/entt/resource/handle.hpp b/src/entt/resource/handle.hpp index a19d9f695..cc4fee80e 100644 --- a/src/entt/resource/handle.hpp +++ b/src/entt/resource/handle.hpp @@ -57,16 +57,16 @@ public: } /*! @copydoc get */ - inline operator const Resource & () const ENTT_NOEXCEPT { return get(); } + operator const Resource & () const ENTT_NOEXCEPT { return get(); } /*! @copydoc get */ - inline operator Resource & () ENTT_NOEXCEPT { return get(); } + operator Resource & () ENTT_NOEXCEPT { return get(); } /*! @copydoc get */ - inline const Resource & operator *() const ENTT_NOEXCEPT { return get(); } + const Resource & operator *() const ENTT_NOEXCEPT { return get(); } /*! @copydoc get */ - inline Resource & operator *() ENTT_NOEXCEPT { return get(); } + Resource & operator *() ENTT_NOEXCEPT { return get(); } /** * @brief Gets a pointer to the managed resource. @@ -79,13 +79,13 @@ public: * @return A pointer to the managed resource or `nullptr` if the handle * contains no resource at all. */ - inline const Resource * operator->() const ENTT_NOEXCEPT { + const Resource * operator->() const ENTT_NOEXCEPT { ENTT_ASSERT(static_cast(resource)); return resource.get(); } /*! @copydoc operator-> */ - inline Resource * operator->() ENTT_NOEXCEPT { + Resource * operator->() ENTT_NOEXCEPT { return const_cast(std::as_const(*this).operator->()); } diff --git a/src/entt/signal/dispatcher.hpp b/src/entt/signal/dispatcher.hpp index 5fe1bab85..0c8bf6443 100644 --- a/src/entt/signal/dispatcher.hpp +++ b/src/entt/signal/dispatcher.hpp @@ -53,17 +53,17 @@ class dispatcher { current %= std::extent::value; } - inline sink_type sink() ENTT_NOEXCEPT { + sink_type sink() ENTT_NOEXCEPT { return signal.sink(); } template - inline void trigger(Args &&... args) { + void trigger(Args &&... args) { signal.publish({ std::forward(args)... }); } template - inline void enqueue(Args &&... args) { + void enqueue(Args &&... args) { events[current].emplace_back(std::forward(args)...); } @@ -143,7 +143,7 @@ public: * @return A temporary sink object. */ template - inline sink_type sink() ENTT_NOEXCEPT { + sink_type sink() ENTT_NOEXCEPT { return assure().sink(); } @@ -158,7 +158,7 @@ public: * @param args Arguments to use to construct the event. */ template - inline void trigger(Args &&... args) { + void trigger(Args &&... args) { assure().trigger(std::forward(args)...); } @@ -172,7 +172,7 @@ public: * @param event An instance of the given type of event. */ template - inline void trigger(Event &&event) { + void trigger(Event &&event) { assure>().trigger(std::forward(event)); } @@ -187,7 +187,7 @@ public: * @param args Arguments to use to construct the event. */ template - inline void enqueue(Args &&... args) { + void enqueue(Args &&... args) { assure().enqueue(std::forward(args)...); } @@ -201,7 +201,7 @@ public: * @param event An instance of the given type of event. */ template - inline void enqueue(Event &&event) { + void enqueue(Event &&event) { assure>().enqueue(std::forward(event)); } @@ -215,7 +215,7 @@ public: * @tparam Event Type of events to send. */ template - inline void update() { + void update() { assure().publish(); } @@ -226,7 +226,7 @@ public: * delivered to the registered listeners. It's responsibility of the users * to reduce at a minimum the time spent in the bodies of the listeners. */ - inline void update() const { + void update() const { for(auto pos = wrappers.size(); pos; --pos) { auto &wdata = wrappers[pos-1]; diff --git a/src/entt/signal/emitter.hpp b/src/entt/signal/emitter.hpp index 1abb50620..7ae50b54a 100644 --- a/src/entt/signal/emitter.hpp +++ b/src/entt/signal/emitter.hpp @@ -73,11 +73,11 @@ class emitter { } } - inline connection_type once(listener_type listener) { + connection_type once(listener_type listener) { return once_list.emplace(once_list.cend(), false, std::move(listener)); } - inline connection_type on(listener_type listener) { + connection_type on(listener_type listener) { return on_list.emplace(on_list.cend(), false, std::move(listener)); }