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

This commit is contained in:
Michele Caini
2020-12-31 11:40:08 +01:00
parent 61e96e2dab
commit ec600eb2f4

View File

@@ -69,7 +69,11 @@ class any {
break;
}
} else if constexpr(in_situ<Type>) {
#if __cpp_lib_launder >= 201606L
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) {
case operation::COPY: