Browse Source

any: no args to new[] (fair enough)

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

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

@@ -134,7 +134,8 @@ class basic_any {
                 if constexpr(std::is_aggregate_v<plain_type> && (sizeof...(Args) != 0u || !std::is_default_constructible_v<plain_type>)) {
                     instance = new plain_type{std::forward<Args>(args)...};
                 } else if constexpr(std::is_array_v<plain_type>) {
-                    instance = new plain_type[std::extent_v<plain_type>](std::forward<Args>(args)...);
+                    static_assert(sizeof...(Args) == 0u);
+                    instance = new plain_type[std::extent_v<plain_type>]();
                 } else {
                     instance = new plain_type(std::forward<Args>(args)...);
                 }