Browse Source

any: use feature tests to get around an issue with clang 6.0.0

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

+ 4 - 0
src/entt/core/any.hpp

@@ -69,7 +69,11 @@ class any {
                     break;
                     break;
                 }
                 }
             } else if constexpr(in_situ<Type>) {
             } else if constexpr(in_situ<Type>) {
+                #if __cpp_lib_launder >= 201606L
                 auto *instance = const_cast<Type *>(std::launder(reinterpret_cast<const Type *>(&from.storage)));
                 auto *instance = const_cast<Type *>(std::launder(reinterpret_cast<const Type *>(&from.storage)));
+                #else
+                auto *instance = const_cast<Type *>(reinterpret_cast<const Type *>(&from.storage));
+                #endif
 
 
                 switch(op) {
                 switch(op) {
                 case operation::COPY:
                 case operation::COPY: