Преглед изворни кода

resource: make return type explicit for operator=

Michele Caini пре 1 година
родитељ
комит
8433060092
1 измењених фајлова са 4 додато и 6 уклоњено
  1. 4 6
      src/entt/resource/resource.hpp

+ 4 - 6
src/entt/resource/resource.hpp

@@ -98,9 +98,8 @@ public:
      * @param other The handle to copy from.
      * @return This resource handle.
      */
-    template<typename Other>
-    std::enable_if_t<is_acceptable_v<Other>, resource &>
-    operator=(const resource<Other> &other) noexcept {
+    template<typename Other, typename = std::enable_if_t<is_acceptable_v<Other>>>
+    resource &operator=(const resource<Other> &other) noexcept {
         value = other.value;
         return *this;
     }
@@ -111,9 +110,8 @@ public:
      * @param other The handle to move from.
      * @return This resource handle.
      */
-    template<typename Other>
-    std::enable_if_t<is_acceptable_v<Other>, resource &>
-    operator=(resource<Other> &&other) noexcept {
+    template<typename Other, typename = std::enable_if_t<is_acceptable_v<Other>>>
+    resource &operator=(resource<Other> &&other) noexcept {
         value = std::move(other.value);
         return *this;
     }