зеркало из https://github.com/microsoft/STL.git
Fuse `<xstddef>` into `<type_traits>` (#3654)
This commit is contained in:
Родитель
522149cff1
Коммит
9bb3566f7f
|
@ -247,7 +247,6 @@ set(HEADERS
|
|||
${CMAKE_CURRENT_LIST_DIR}/inc/xnode_handle.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/inc/xpolymorphic_allocator.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/inc/xsmf_control.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/inc/xstddef
|
||||
${CMAKE_CURRENT_LIST_DIR}/inc/xstring
|
||||
${CMAKE_CURRENT_LIST_DIR}/inc/xthreads.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/inc/xtimec.h
|
||||
|
|
|
@ -153,7 +153,6 @@
|
|||
"xnode_handle.h",
|
||||
"xpolymorphic_allocator.h",
|
||||
"xsmf_control.h",
|
||||
"xstddef",
|
||||
"xstring",
|
||||
"xthreads.h",
|
||||
"xtimec.h",
|
||||
|
|
|
@ -8,8 +8,9 @@
|
|||
#define _TYPE_TRAITS_
|
||||
#include <yvals_core.h>
|
||||
#if _STL_COMPILER_PREPROCESSOR
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <xstddef>
|
||||
#include <xtr1common>
|
||||
|
||||
#pragma pack(push, _CRT_PACKING)
|
||||
#pragma warning(push, _STL_WARNING_LEVEL)
|
||||
|
@ -19,6 +20,10 @@ _STL_DISABLE_CLANG_WARNINGS
|
|||
#undef new
|
||||
|
||||
_STD_BEGIN
|
||||
template <class>
|
||||
// TRANSITION, CWG-2518: false value attached to a dependent name (for static_assert)
|
||||
_INLINE_VAR constexpr bool _Always_false = false;
|
||||
|
||||
_EXPORT_STD template <class _Ty, _Ty... _Vals>
|
||||
struct integer_sequence { // sequence of integer parameters
|
||||
static_assert(is_integral_v<_Ty>, "integer_sequence<T, I...> requires T to be an integral type.");
|
||||
|
|
|
@ -1,32 +0,0 @@
|
|||
// xstddef internal header (core)
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
|
||||
#pragma once
|
||||
#ifndef _XSTDDEF_
|
||||
#define _XSTDDEF_
|
||||
#include <yvals_core.h>
|
||||
#if _STL_COMPILER_PREPROCESSOR
|
||||
#include <cstddef>
|
||||
#include <xtr1common>
|
||||
|
||||
#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
|
||||
template <class>
|
||||
// TRANSITION, CWG-2518: false value attached to a dependent name (for static_assert)
|
||||
_INLINE_VAR constexpr bool _Always_false = false;
|
||||
_STD_END
|
||||
|
||||
#pragma pop_macro("new")
|
||||
_STL_RESTORE_CLANG_WARNINGS
|
||||
#pragma warning(pop)
|
||||
#pragma pack(pop)
|
||||
#endif // _STL_COMPILER_PREPROCESSOR
|
||||
#endif // _XSTDDEF_
|
|
@ -21,7 +21,6 @@
|
|||
|
||||
// <__msvc_iter_core.hpp> is included by <tuple>
|
||||
// <xkeycheck.h> should not be included outside of <yvals_core.h>
|
||||
// <xstddef> is included by <type_traits>
|
||||
// <xtr1common> is included by <cstddef>
|
||||
// <yvals_core.h> is included by every public core header
|
||||
|
||||
|
|
|
@ -1624,7 +1624,7 @@ void typeindex_test() {
|
|||
|
||||
template <typename FunctorArg, typename Arg>
|
||||
void functors_test_impl(Arg val) {
|
||||
// Following from <xstddef>:
|
||||
// Following from <type_traits> and <xutility>:
|
||||
(void) plus<FunctorArg>()(val, val);
|
||||
(void) minus<FunctorArg>()(val, val);
|
||||
(void) multiplies<FunctorArg>()(val, val);
|
||||
|
|
|
@ -124,7 +124,7 @@ void type_traits_test_impl() {
|
|||
TRAIT_V(is_null_pointer, T);
|
||||
TRAIT_V(is_union, T);
|
||||
TRAIT_V(is_class, T);
|
||||
TRAIT_V(is_function, T); // from xstddef
|
||||
TRAIT_V(is_function, T);
|
||||
TRAIT_V(is_fundamental, T);
|
||||
TRAIT_V(is_arithmetic, T); // from xtr1common
|
||||
TRAIT_V(is_object, T);
|
||||
|
|
Загрузка…
Ссылка в новой задаче