Browse Source

resource: make return type explicit for operator=

Michele Caini 1 year ago
parent
commit
8433060092
1 changed files with 4 additions and 6 deletions
  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;
     }