Browse Source

any: make return type explicit for operator=

Michele Caini 1 year ago
parent
commit
7718b1bb9a
1 changed files with 2 additions and 3 deletions
  1. 2 3
      src/entt/core/any.hpp

+ 2 - 3
src/entt/core/any.hpp

@@ -253,9 +253,8 @@ public:
      * @param value An instance of an object to use to initialize the wrapper.
      * @return This any object.
      */
-    template<typename Type>
-    std::enable_if_t<!std::is_same_v<std::decay_t<Type>, basic_any>, basic_any &>
-    operator=(Type &&value) {
+    template<typename Type, typename = std::enable_if_t<!std::is_same_v<std::decay_t<Type>, basic_any>>>
+    basic_any &operator=(Type &&value) {
         emplace<std::decay_t<Type>>(std::forward<Type>(value));
         return *this;
     }