diff --git a/stl/CMakeLists.txt b/stl/CMakeLists.txt index 9596c5d169..ef34a76356 100644 --- a/stl/CMakeLists.txt +++ b/stl/CMakeLists.txt @@ -7,6 +7,7 @@ set(HEADERS ${CMAKE_CURRENT_LIST_DIR}/inc/any ${CMAKE_CURRENT_LIST_DIR}/inc/array ${CMAKE_CURRENT_LIST_DIR}/inc/atomic + ${CMAKE_CURRENT_LIST_DIR}/inc/bit ${CMAKE_CURRENT_LIST_DIR}/inc/bitset ${CMAKE_CURRENT_LIST_DIR}/inc/cassert ${CMAKE_CURRENT_LIST_DIR}/inc/ccomplex diff --git a/stl/inc/__msvc_all_public_headers.hpp b/stl/inc/__msvc_all_public_headers.hpp index 66688081eb..1776787134 100644 --- a/stl/inc/__msvc_all_public_headers.hpp +++ b/stl/inc/__msvc_all_public_headers.hpp @@ -40,6 +40,7 @@ #include #include #include +#include #include #include #include diff --git a/stl/inc/bit b/stl/inc/bit new file mode 100644 index 0000000000..4db71a6390 --- /dev/null +++ b/stl/inc/bit @@ -0,0 +1,33 @@ +// bit standard header (core) + +// Copyright (c) Microsoft Corporation. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +#pragma once +#ifndef _BIT_ +#define _BIT_ +#include +#if _STL_COMPILER_PREPROCESSOR +#if !_HAS_CXX20 +#pragma message("The contents of are available only with C++20 or later.") +#else // ^^^ !_HAS_CXX20 / _HAS_CXX20 vvv + +#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 + +_STD_BEGIN +enum class endian { little = 0, big = 1, native = little }; + +_STD_END + +#pragma pop_macro("new") +_STL_RESTORE_CLANG_WARNINGS +#pragma warning(pop) +#pragma pack(pop) +#endif // _HAS_CXX20 +#endif // _STL_COMPILER_PREPROCESSOR +#endif // _BIT_ diff --git a/stl/inc/type_traits b/stl/inc/type_traits index 190994f281..bed0e166bf 100644 --- a/stl/inc/type_traits +++ b/stl/inc/type_traits @@ -72,11 +72,6 @@ struct negation : bool_constant(_Trait::value)> {}; // The ne template _INLINE_VAR constexpr bool negation_v = negation<_Trait>::value; -#if _HAS_CXX20 -// ENUM CLASS endian -enum class endian { little = 0, big = 1, native = little }; -#endif // _HAS_CXX20 - // STRUCT TEMPLATE _Arg_types template struct _Arg_types {}; // provide argument_type, etc. (sometimes) diff --git a/stl/inc/yvals_core.h b/stl/inc/yvals_core.h index 9412cc07ae..88df38ed05 100644 --- a/stl/inc/yvals_core.h +++ b/stl/inc/yvals_core.h @@ -52,6 +52,7 @@ // P1227R2 Signed std::ssize(), Unsigned span::size() // (partially implemented) // P1357R1 is_bounded_array, is_unbounded_array +// P1612R1 Relocating endian To // P1651R0 bind_front() Should Not Unwrap reference_wrapper // P1754R1 Rename Concepts To standard_case // P????R? directory_entry::clear_cache() @@ -959,6 +960,7 @@ #endif // _HAS_STD_BOOLEAN #endif // defined(__cpp_concepts) && __cpp_concepts > 201507L +#define __cpp_lib_endian 201907L #define __cpp_lib_erase_if 201811L #define __cpp_lib_generic_unordered_lookup 201811L #define __cpp_lib_list_remove_return_type 201806L