diff options
Diffstat (limited to 'libstdc++-v3/include/std')
-rw-r--r-- | libstdc++-v3/include/std/ranges | 13 | ||||
-rw-r--r-- | libstdc++-v3/include/std/utility | 19 |
2 files changed, 32 insertions, 0 deletions
diff --git a/libstdc++-v3/include/std/ranges b/libstdc++-v3/include/std/ranges index fd290ea..25d2e28 100644 --- a/libstdc++-v3/include/std/ranges +++ b/libstdc++-v3/include/std/ranges @@ -65,6 +65,7 @@ #define __glibcxx_want_ranges_chunk #define __glibcxx_want_ranges_chunk_by #define __glibcxx_want_ranges_enumerate +#define __glibcxx_want_ranges_indices #define __glibcxx_want_ranges_join_with #define __glibcxx_want_ranges_repeat #define __glibcxx_want_ranges_slide @@ -785,6 +786,18 @@ namespace views }; inline constexpr _Iota iota{}; + +#ifdef __cpp_lib_ranges_indices // C++ >= 26 + struct _Indices + { + template<ranges::__detail::__is_integer_like _Tp> + [[nodiscard]] constexpr auto + operator() (_Tp __e) const noexcept + { return iota(_Tp{}, __e); } + }; + + inline constexpr _Indices indices{}; +#endif // __cpp_lib_ranges_indices } // namespace views #if _GLIBCXX_HOSTED diff --git a/libstdc++-v3/include/std/utility b/libstdc++-v3/include/std/utility index 8a85ccf..3ae1852 100644 --- a/libstdc++-v3/include/std/utility +++ b/libstdc++-v3/include/std/utility @@ -98,6 +98,7 @@ #define __glibcxx_want_tuple_element_t #define __glibcxx_want_tuples_by_type #define __glibcxx_want_unreachable +#define __glibcxx_want_observable_checkpoint #define __glibcxx_want_tuple_like #define __glibcxx_want_constrained_equality #include <bits/version.h> @@ -234,6 +235,24 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION } #endif + +#ifdef __cpp_lib_observable_checkpoint // C++ >= 26 + /// Informs the compiler that prior actions are considered observable. + /** + * This may be used to limit the extent to which optimisations based on the + * assumed unreachability of undefined behaviour can propagate to earlier + * code. + * + * @since C++26 + */ + [[__gnu__::__always_inline__]] + inline void + observable_checkpoint() noexcept + { + return __builtin_observable_checkpoint(); + } +#endif + _GLIBCXX_END_NAMESPACE_VERSION } // namespace |