Browse Source

any: minor changes

Michele Caini 5 years ago
parent
commit
a4d16bffd3
1 changed files with 3 additions and 3 deletions
  1. 3 3
      src/entt/core/any.hpp

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

@@ -171,8 +171,8 @@ public:
      */
      */
     template<typename Type, typename... Args>
     template<typename Type, typename... Args>
     explicit basic_any(std::in_place_type_t<Type>, [[maybe_unused]] Args &&... args)
     explicit basic_any(std::in_place_type_t<Type>, [[maybe_unused]] Args &&... args)
-        : vtable{&basic_vtable<Type>},
-          instance{}
+        : instance{},
+          vtable{&basic_vtable<Type>}
     {
     {
         if constexpr(!std::is_void_v<Type>) {
         if constexpr(!std::is_void_v<Type>) {
             if constexpr(std::is_lvalue_reference_v<Type>) {
             if constexpr(std::is_lvalue_reference_v<Type>) {
@@ -329,8 +329,8 @@ public:
     }
     }
 
 
 private:
 private:
+    union { const void *instance; storage_type storage; };
     vtable_type *vtable;
     vtable_type *vtable;
-    union { const void *instance; storage_type storage{}; };
 };
 };