#pragma once #include "core.h" namespace vlc { #ifndef VLC_HAS_STD_ALIGNED_UNION namespace detail { template struct Max; template<> struct Max<> { static constexpr size_t value = 0; }; template struct Max { static constexpr size_t value = val; }; template struct Max : public Max { }; } template struct aligned_union { static constexpr size_t len = detail::Max::value; static constexpr size_t alignment = detail::Max::value...>::value; using type = typename std::aligned_storage::type; }; #else using std::aligned_union; #endif }