Skip to content

Commit

Permalink
P1612R1 Relocating endian To <bit> (#305)
Browse files Browse the repository at this point in the history
Resolves  #61.
  • Loading branch information
AdamBucior authored and StephanTLavavej committed Nov 19, 2019
1 parent 580e61a commit c5aaa28
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 5 deletions.
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

0 comments on commit c5aaa28

Please sign in to comment.