std::ranges...ange::begin(3)
π
std::ranges...ange::begin(3) β bestie edition π
Okay so this page lives in the C++ Standard Libary manual, and todayβs main character is std::ranges::subrange::begin. The whole vibe: you get the iterator to the first element of the subrange, or the end iterator if the view is empty. Slay. β¨
πΈ NAME πΈ
std::ranges::subrange::begin - std::ranges::subrange::begin
β¨ Synopsis β¨
constexpr I begin() const requires std::copyable<I>; (1)
(since C++20)
[[nodiscard]] constexpr I begin() requires (!std::copyable<I>); (2)
(since C++20)
Obtains the iterator to the first element of the subrange, or the end iterator if the view is empty.
Thereβs a lil manual visual called range-begin-end.svg β beginning/end diagram vibes. π¦
- Returns a copy of the stored iterator if the iterator type is copyable.
- Returns an iterator move-constructed from the stored iterator if the iterator type is not copyable.
π Parameters π
(none) β zero, nada, no parameters, bestie. π
β Return value β
- An iterator copy-constructed from the stored iterator.
- An iterator move-constructed from the stored iterator.
π Notes π
A call to(2)may leave the stored iterator in a valid but unspecified state, depending on the behavior of the move constructor ofI. So likeβ¦ valid, but not necessarily the same, okay? π
π Example π
This section is incomplete. Reason: no example.
π¦ See also π¦
endβ obtains the sentinel;(C++20);(public member function)begin,cbeginβ returns an iterator to the beginning of a container or array;(C++11);(function template);(C++14)ranges::beginβ returns an iterator to the beginning of a range;(C++20);(customization point object)
π Category π
* Todo no example
XOXO, your fave manual π source/version/date/page: http://cppreference.com, 2024.06.10, std::ranges...ange::begin(3). Mwah! πβ¨
π¦ where this page comes from
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms