Browse Source

*: coding style

Michele Caini 1 year ago
parent
commit
1fd0a6f318
3 changed files with 11 additions and 11 deletions
  1. 3 3
      src/entt/entity/storage.hpp
  2. 3 3
      src/entt/poly/poly.hpp
  3. 5 5
      src/entt/resource/resource.hpp

+ 3 - 3
src/entt/entity/storage.hpp

@@ -304,11 +304,11 @@ private:
     }
 
     void swap_or_move([[maybe_unused]] const std::size_t from, [[maybe_unused]] const std::size_t to) override {
-        static constexpr bool is_pinned_type_v = !(std::is_move_constructible_v<Type> && std::is_move_assignable_v<Type>);
+        static constexpr bool is_pinned_type = !(std::is_move_constructible_v<Type> && std::is_move_assignable_v<Type>);
         // use a runtime value to avoid compile-time suppression that drives the code coverage tool crazy
-        ENTT_ASSERT((from + 1u) && !is_pinned_type_v, "Pinned type");
+        ENTT_ASSERT((from + 1u) && !is_pinned_type, "Pinned type");
 
-        if constexpr(!is_pinned_type_v) {
+        if constexpr(!is_pinned_type) {
             auto &elem = element_at(from);
 
             if constexpr(traits_type::in_place_delete) {

+ 3 - 3
src/entt/poly/poly.hpp

@@ -97,11 +97,11 @@ class poly_vtable {
     }
 
     using vtable_type = decltype(make_vtable(Concept{}));
-    static constexpr bool is_mono_v = std::tuple_size_v<vtable_type> == 1u;
+    static constexpr bool is_mono = std::tuple_size_v<vtable_type> == 1u;
 
 public:
     /*! @brief Virtual table type. */
-    using type = std::conditional_t<is_mono_v, std::tuple_element_t<0u, vtable_type>, const vtable_type *>;
+    using type = std::conditional_t<is_mono, std::tuple_element_t<0u, vtable_type>, const vtable_type *>;
 
     /**
      * @brief Returns a static virtual table for a specific concept and type.
@@ -113,7 +113,7 @@ public:
         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>{});
 
-        if constexpr(is_mono_v) {
+        if constexpr(is_mono) {
             return std::get<0>(vtable);
         } else {
             return &vtable;

+ 5 - 5
src/entt/resource/resource.hpp

@@ -24,7 +24,7 @@ class resource {
     friend class resource;
 
     template<typename Other>
-    static constexpr bool is_acceptable_v = !std::is_same_v<Type, Other> && std::is_constructible_v<Type &, Other &>;
+    static constexpr bool is_acceptable = !std::is_same_v<Type, Other> && std::is_constructible_v<Type &, Other &>;
 
 public:
     /*! @brief Resource type. */
@@ -64,7 +64,7 @@ public:
      * @tparam Other Type of resource managed by the received handle.
      * @param other The handle to copy from.
      */
-    template<typename Other, typename = std::enable_if_t<is_acceptable_v<Other>>>
+    template<typename Other, typename = std::enable_if_t<is_acceptable<Other>>>
     resource(const resource<Other> &other) noexcept
         : value{other.value} {}
 
@@ -73,7 +73,7 @@ public:
      * @tparam Other Type of resource managed by the received handle.
      * @param other The handle to move from.
      */
-    template<typename Other, typename = std::enable_if_t<is_acceptable_v<Other>>>
+    template<typename Other, typename = std::enable_if_t<is_acceptable<Other>>>
     resource(resource<Other> &&other) noexcept
         : value{std::move(other.value)} {}
 
@@ -98,7 +98,7 @@ public:
      * @param other The handle to copy from.
      * @return This resource handle.
      */
-    template<typename Other, typename = std::enable_if_t<is_acceptable_v<Other>>>
+    template<typename Other, typename = std::enable_if_t<is_acceptable<Other>>>
     resource &operator=(const resource<Other> &other) noexcept {
         value = other.value;
         return *this;
@@ -110,7 +110,7 @@ public:
      * @param other The handle to move from.
      * @return This resource handle.
      */
-    template<typename Other, typename = std::enable_if_t<is_acceptable_v<Other>>>
+    template<typename Other, typename = std::enable_if_t<is_acceptable<Other>>>
     resource &operator=(resource<Other> &&other) noexcept {
         value = std::move(other.value);
         return *this;