Browse Source

any: limit ownership construction to non-const pointers

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

+ 1 - 1
src/entt/core/any.hpp

@@ -191,7 +191,7 @@ public:
      * @tparam Type Type of object to use to initialize the wrapper.
      * @param value A pointer to an object to take ownership of.
      */
-    template<typename Type, typename = std::enable_if_t<!std::is_void_v<std::remove_const_t<Type>>>>
+    template<typename Type, typename = std::enable_if_t<!std::is_const_v<Type> && !std::is_void_v<Type>>>
     explicit basic_any(std::in_place_t, Type *value)
         : instance{value} {
         if(instance != nullptr) {