[libc++] Implement P3016R6: Resolve inconsistencies in begin/end for `valarray` and braced initializer lists (#173637)

This paper is implemented as a Defect Report against C++11 and later
revisions.

- Inclusion of `<typeinfo>` in `<functional>` should be considered as a
  patch to C++ TR1 (https://wg21.link/N1836), while the related
  parts were merged into C++11.
- Changes of `initializer_list` should be considered as a patch to C++11
  paper https://wg21.link/n2672.
- Changes of `valarray`, `std::begin`, and `std::end` and availability
  of range access functions in `<valarray>` should be considered as a
  patch to C++11 paper https://wg21.link/n2930.
- Inclusion of `<typeinfo>` in `<typeindex>` should be considered as a
  patch to C++11 paper https://wg21.link/n2932.
- Changes of `std::cbegin`, `std::cend`, `std::rbegin`, `std::rend`,
  `std::crbegin`, and `std::crend` and the inclusion of
  `<initializer_list>` in `<iterator>` should be considered as a patch to
  https://wg21.link/lwg2128, while LWG2128 is consistently
  considered to be a pure feature addition in C++14 by implementations.
- Changes of `std::data`, `std::empty`, and `std::size` should be
  considered as a patch to C++17 paper https://wg21.link/n4280.
- Inclusion of `<initializer_list>` and `<typeinfo>` in `<any>` should
  be considered as a patch to C++17 paper https://wg21.link/p0220r1.
- Changes of `std::ssize` should be considered as a patch to C++20 paper
  https://wg21.link/p1227r2.
- Inclusion of `<initializer_list>` in `<functional>` should be
  considered as a patch to C++23 paper https://wg21.link/p0288r9.
- Availability of range access functions in `<stacktrace>` should be
  considered as a patch to C++23 paper https://wg21.link/p0881r7.
- Availability of range access functions in `<optional>` should be
  considered as a patch to C++26 paper https://wg21.link/p3168r2.

Notes for backported and missing parts:
- Changes of `<stacktrace>` are not implemented because P0881R7 is not
  implemented. But I think P3016R6 should be considered complete, with
  note added.
- `constexpr` for member functions of `initializer_list` is only added
  since C++14, in the spirit of C++14 paper https://wg21.link/n3471.
- Changes of inclusions and `valarray` are unconditionally implemented,
  which follows the current convention of libc++.

Fixes #171271.

GitOrigin-RevId: 8248eef4bea83086c4487215a465771f79e8759b
42 files changed