[libcxx-commits] [libcxx] [libc++] Implement P2988R12: `std::optional<T&>` (PR #155202)
A. Jiang via libcxx-commits
libcxx-commits at lists.llvm.org
Sat Nov 8 03:02:48 PST 2025
https://github.com/frederick-vs-ja requested changes to this pull request.
Oh... I forgot the following partial specialization. Looks like that it isn't added yet.
```C++
template<class T>
constexpr bool ranges::enable_borrowed_range<optional<T&>> = true;
```
I think we should test that
- `ranges::enable_borrowed_range<optional<T&>>` is `true` for all `T`, even if `T` is an array of unknown bound or a function type;
- `ranges::borrow_range<optional<T&>>` is `true` if and only if `ranges::range<optional<T&>>` is `true`. It should be `false` when `T` is a function type.
https://github.com/llvm/llvm-project/pull/155202
More information about the libcxx-commits
mailing list