mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-17 03:46:46 +00:00
parent
25938389c0
commit
357306572d
@ -44,6 +44,7 @@ Implemented Papers
|
||||
- P2255R2: A type trait to detect reference binding to temporary (implemented the type traits only) (`Github <https://github.com/llvm/llvm-project/issues/105180>`__)
|
||||
- P2562R1: ``constexpr`` Stable Sorting (`Github <https://github.com/llvm/llvm-project/issues/105360>`__)
|
||||
- P1222R4: A Standard ``flat_set`` is partially implemented and ``flat_set`` is provided (`Github <https://github.com/llvm/llvm-project/issues/105193>`__)
|
||||
- P0472R3: Put std::monostate in <utility> (`Github <https://github.com/llvm/llvm-project/issues/127874>`__)
|
||||
|
||||
Improvements and New Features
|
||||
-----------------------------
|
||||
|
@ -102,7 +102,7 @@
|
||||
"`P3475R2 <https://wg21.link/P3475R2>`__","Defang and deprecate ``memory_order::consume``","2025-02 (Hagenberg)","","",""
|
||||
"`P2786R13 <https://wg21.link/P2786R13>`__","Trivial Relocatability For C++26","2025-02 (Hagenberg)","","",""
|
||||
"`P3137R3 <https://wg21.link/P3137R3>`__","``views::to_input``","2025-02 (Hagenberg)","","",""
|
||||
"`P0472R3 <https://wg21.link/P0472R3>`__","Put ``std::monostate`` in ``<utility>``","2025-02 (Hagenberg)","","",""
|
||||
"`P0472R3 <https://wg21.link/P0472R3>`__","Put ``std::monostate`` in ``<utility>``","2025-02 (Hagenberg)","|Complete|","21",""
|
||||
"`P3349R1 <https://wg21.link/P3349R1>`__","Converting contiguous iterators to pointers","2025-02 (Hagenberg)","","",""
|
||||
"`P3372R3 <https://wg21.link/P3372R3>`__","constexpr containers and adaptors","2025-02 (Hagenberg)","","",""
|
||||
"`P3378R2 <https://wg21.link/P3378R2>`__","constexpr exception types","2025-02 (Hagenberg)","","",""
|
||||
|
|
@ -279,6 +279,10 @@ template <class T>
|
||||
# include <__utility/unreachable.h>
|
||||
# endif
|
||||
|
||||
# if _LIBCPP_STD_VER >= 26
|
||||
# include <__variant/monostate.h>
|
||||
# endif
|
||||
|
||||
# include <version>
|
||||
|
||||
// standard-mandated includes
|
||||
|
@ -301,6 +301,7 @@ experimental/type_traits type_traits
|
||||
experimental/type_traits version
|
||||
experimental/utility compare
|
||||
experimental/utility cstdint
|
||||
experimental/utility cstring
|
||||
experimental/utility initializer_list
|
||||
experimental/utility limits
|
||||
experimental/utility utility
|
||||
@ -1127,6 +1128,7 @@ unordered_set tuple
|
||||
unordered_set version
|
||||
utility compare
|
||||
utility cstdint
|
||||
utility cstring
|
||||
utility initializer_list
|
||||
utility limits
|
||||
utility version
|
||||
|
|
@ -0,0 +1,47 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
||||
// See https://llvm.org/LICENSE.txt for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// REQUIRES: std-at-least-c++26
|
||||
|
||||
// <utility>
|
||||
|
||||
// constexpr bool operator<(monostate, monostate) noexcept { return false; }
|
||||
// constexpr bool operator>(monostate, monostate) noexcept { return false; }
|
||||
// constexpr bool operator<=(monostate, monostate) noexcept { return true; }
|
||||
// constexpr bool operator>=(monostate, monostate) noexcept { return true; }
|
||||
// constexpr bool operator==(monostate, monostate) noexcept { return true; }
|
||||
// constexpr bool operator!=(monostate, monostate) noexcept { return false; }
|
||||
// constexpr strong_ordering operator<=>(monostate, monostate) noexcept { return strong_ordering::equal; } // since C++20
|
||||
|
||||
#include <cassert>
|
||||
#include <utility>
|
||||
|
||||
#include "test_comparisons.h"
|
||||
#include "test_macros.h"
|
||||
|
||||
constexpr bool test() {
|
||||
using M = std::monostate;
|
||||
constexpr M m1{};
|
||||
constexpr M m2{};
|
||||
assert(testComparisons(m1, m2, /*isEqual*/ true, /*isLess*/ false));
|
||||
AssertComparisonsAreNoexcept<M>();
|
||||
|
||||
#if TEST_STD_VER > 17
|
||||
assert(testOrder(m1, m2, std::strong_ordering::equal));
|
||||
AssertOrderAreNoexcept<M>();
|
||||
#endif // TEST_STD_VER > 17
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
int main(int, char**) {
|
||||
test();
|
||||
static_assert(test());
|
||||
|
||||
return 0;
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
||||
// See https://llvm.org/LICENSE.txt for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// REQUIRES: std-at-least-c++26
|
||||
|
||||
// <utility>
|
||||
|
||||
// struct monostate {};
|
||||
|
||||
#include <type_traits>
|
||||
#include <utility>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
int main(int, char**) {
|
||||
using M = std::monostate;
|
||||
static_assert(std::is_trivially_default_constructible<M>::value, "");
|
||||
static_assert(std::is_trivially_copy_constructible<M>::value, "");
|
||||
static_assert(std::is_trivially_copy_assignable<M>::value, "");
|
||||
static_assert(std::is_trivially_destructible<M>::value, "");
|
||||
constexpr M m{};
|
||||
((void)m);
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user