Browse Source

poly: prepare to remove ENTT_NOEXCEPT[_IF]

Michele Caini 3 years ago
parent
commit
971f371eab
1 changed files with 15 additions and 16 deletions
  1. 15 16
      src/entt/poly/poly.hpp

+ 15 - 16
src/entt/poly/poly.hpp

@@ -6,7 +6,6 @@
 #include <tuple>
 #include <type_traits>
 #include <utility>
-#include "../config/config.h"
 #include "../core/any.hpp"
 #include "../core/type_info.hpp"
 #include "../core/type_traits.hpp"
@@ -64,11 +63,11 @@ class poly_vtable {
     static auto vtable_entry(Ret (inspector::*)(Args...) const) -> Ret (*)(const basic_any<Len, Align> &, Args...);
 
     template<auto... Candidate>
-    static auto make_vtable(value_list<Candidate...>) ENTT_NOEXCEPT
+    static auto make_vtable(value_list<Candidate...>) noexcept
         -> decltype(std::make_tuple(vtable_entry(Candidate)...));
 
     template<typename... Func>
-    [[nodiscard]] static constexpr auto make_vtable(type_list<Func...>) ENTT_NOEXCEPT {
+    [[nodiscard]] static constexpr auto make_vtable(type_list<Func...>) noexcept {
         if constexpr(sizeof...(Func) == 0u) {
             return decltype(make_vtable(typename Concept::template impl<inspector>{})){};
         } else if constexpr((std::is_function_v<Func> && ...)) {
@@ -77,7 +76,7 @@ class poly_vtable {
     }
 
     template<typename Type, auto Candidate, typename Ret, typename Any, typename... Args>
-    static void fill_vtable_entry(Ret (*&entry)(Any &, Args...)) ENTT_NOEXCEPT {
+    static void fill_vtable_entry(Ret (*&entry)(Any &, Args...)) noexcept {
         if constexpr(std::is_invocable_r_v<Ret, decltype(Candidate), Args...>) {
             entry = +[](Any &, Args... args) -> Ret {
                 return std::invoke(Candidate, std::forward<Args>(args)...);
@@ -90,7 +89,7 @@ class poly_vtable {
     }
 
     template<typename Type, auto... Index>
-    [[nodiscard]] static auto fill_vtable(std::index_sequence<Index...>) ENTT_NOEXCEPT {
+    [[nodiscard]] static auto fill_vtable(std::index_sequence<Index...>) noexcept {
         vtable_type impl{};
         (fill_vtable_entry<Type, value_list_element_v<Index, typename Concept::template impl<Type>>>(std::get<Index>(impl)), ...);
         return impl;
@@ -109,7 +108,7 @@ public:
      * @return A static virtual table for the given concept and type.
      */
     template<typename Type>
-    [[nodiscard]] static type instance() ENTT_NOEXCEPT {
+    [[nodiscard]] static type instance() noexcept {
         static_assert(std::is_same_v<Type, std::decay_t<Type>>, "Type differs from its decayed form");
         static const vtable_type vtable = fill_vtable<Type>(std::make_index_sequence<Concept::template impl<Type>::size>{});
 
@@ -201,7 +200,7 @@ public:
     using vtable_type = typename poly_vtable<Concept, Len, Align>::type;
 
     /*! @brief Default constructor. */
-    basic_poly() ENTT_NOEXCEPT
+    basic_poly() noexcept
         : storage{},
           vtable{} {}
 
@@ -222,14 +221,14 @@ public:
      * @param value An instance of an object to use to initialize the poly.
      */
     template<typename Type, typename = std::enable_if_t<!std::is_same_v<std::remove_cv_t<std::remove_reference_t<Type>>, basic_poly>>>
-    basic_poly(Type &&value) ENTT_NOEXCEPT
+    basic_poly(Type &&value) noexcept
         : basic_poly{std::in_place_type<std::remove_cv_t<std::remove_reference_t<Type>>>, std::forward<Type>(value)} {}
 
     /**
      * @brief Returns the object type if any, `type_id<void>()` otherwise.
      * @return The object type if any, `type_id<void>()` otherwise.
      */
-    [[nodiscard]] const type_info &type() const ENTT_NOEXCEPT {
+    [[nodiscard]] const type_info &type() const noexcept {
         return storage.type();
     }
 
@@ -237,12 +236,12 @@ public:
      * @brief Returns an opaque pointer to the contained instance.
      * @return An opaque pointer the contained instance, if any.
      */
-    [[nodiscard]] const void *data() const ENTT_NOEXCEPT {
+    [[nodiscard]] const void *data() const noexcept {
         return storage.data();
     }
 
     /*! @copydoc data */
-    [[nodiscard]] void *data() ENTT_NOEXCEPT {
+    [[nodiscard]] void *data() noexcept {
         return storage.data();
     }
 
@@ -268,7 +267,7 @@ public:
      * @brief Returns false if a poly is empty, true otherwise.
      * @return False if the poly is empty, true otherwise.
      */
-    [[nodiscard]] explicit operator bool() const ENTT_NOEXCEPT {
+    [[nodiscard]] explicit operator bool() const noexcept {
         return static_cast<bool>(storage);
     }
 
@@ -276,12 +275,12 @@ public:
      * @brief Returns a pointer to the underlying concept.
      * @return A pointer to the underlying concept.
      */
-    [[nodiscard]] concept_type *operator->() ENTT_NOEXCEPT {
+    [[nodiscard]] concept_type *operator->() noexcept {
         return this;
     }
 
     /*! @copydoc operator-> */
-    [[nodiscard]] const concept_type *operator->() const ENTT_NOEXCEPT {
+    [[nodiscard]] const concept_type *operator->() const noexcept {
         return this;
     }
 
@@ -289,7 +288,7 @@ public:
      * @brief Aliasing constructor.
      * @return A poly that shares a reference to an unmanaged object.
      */
-    [[nodiscard]] basic_poly as_ref() ENTT_NOEXCEPT {
+    [[nodiscard]] basic_poly as_ref() noexcept {
         basic_poly ref{};
         ref.storage = storage.as_ref();
         ref.vtable = vtable;
@@ -297,7 +296,7 @@ public:
     }
 
     /*! @copydoc as_ref */
-    [[nodiscard]] basic_poly as_ref() const ENTT_NOEXCEPT {
+    [[nodiscard]] basic_poly as_ref() const noexcept {
         basic_poly ref{};
         ref.storage = storage.as_ref();
         ref.vtable = vtable;