Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Relocate endian to <bit> #305

Merged
merged 9 commits into from
Nov 19, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions stl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions stl/inc/__msvc_all_public_headers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
#include <algorithm>
#include <any>
#include <array>
#include <bit>
#include <bitset>
#include <charconv>
#include <chrono>
Expand Down
33 changes: 33 additions & 0 deletions stl/inc/bit
Original file line number Diff line number Diff line change
@@ -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 <yvals_core.h>
#if _STL_COMPILER_PREPROCESSOR
#if !_HAS_CXX20
#pragma message("The contents of <bit> 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_
5 changes: 0 additions & 5 deletions stl/inc/type_traits
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,6 @@ struct negation : bool_constant<!static_cast<bool>(_Trait::value)> {}; // The ne
template <class _Trait>
_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 <class... _Types>
struct _Arg_types {}; // provide argument_type, etc. (sometimes)
Expand Down
2 changes: 2 additions & 0 deletions stl/inc/yvals_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
// P1227R2 Signed std::ssize(), Unsigned span::size()
// (partially implemented)
// P1357R1 is_bounded_array, is_unbounded_array
// P1612R1 Relocating endian To <bit>
// P1651R0 bind_front() Should Not Unwrap reference_wrapper
// P1754R1 Rename Concepts To standard_case
// P????R? directory_entry::clear_cache()
Expand Down Expand Up @@ -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
Expand Down