// variant standard header // Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #pragma once #ifndef _VARIANT_ #define _VARIANT_ #include #if _STL_COMPILER_PREPROCESSOR #if !_HAS_CXX17 #pragma message("The contents of are available only with C++17 or later.") #else // ^^^ !_HAS_CXX17 / _HAS_CXX17 vvv #include #include #include #include #include #include #include #pragma pack(push, _CRT_PACKING) #pragma warning(push, _STL_WARNING_LEVEL) #pragma warning(disable : _STL_DISABLED_WARNINGS) _STL_DISABLE_CLANG_WARNINGS #pragma push_macro("new") #undef new #ifdef __clang__ #define _STL_UNREACHABLE __builtin_unreachable() #else // ^^^ clang ^^^ / vvv other vvv #define _STL_UNREACHABLE __assume(false) #endif // __clang__ _STD_BEGIN // TYPE TRAITS template struct _All_same : true_type {}; template struct _All_same<_First, _Rest...> : bool_constant...>> {}; // variadic is_same template struct _Convertible_from_all : bool_constant...>> { // variadic is_convertible }; // METAPROGRAMMING UTILITIES template struct _Meta_list {}; // a sequence of types struct _Meta_nil {}; // ALIAS TEMPLATE _Meta_front template struct _Meta_front_; template using _Meta_front = // extract the first type in a sequence (head of list) typename _Meta_front_<_List>::type; template