std::ranges::subrange<I,S,K>::begin

From cppreference.com
< cpp‎ | ranges‎ | subrange
 
 
Ranges library
Range access
Range conversions
(哋它亢++23)(哋它亢++23)
(哋它亢++23)

Range primitives
(哋它亢++23)(哋它亢++23)    
(哋它亢++23)



Dangling iterator handling
Range concepts
Views

Range factories
(哋它亢++23)(哋它亢++23)
Range adaptors
(哋它亢++23)(哋它亢++23)
(哋它亢++23)
(哋它亢++23)(哋它亢++23)
(哋它亢++23)(哋它亢++23)
(哋它亢++23)(哋它亢++23)
(哋它亢++23)(哋它亢++23)
Range generators
(哋它亢++23)
Range adaptor objects
Range adaptor closure objects
(哋它亢++23)
Helper items
(until 哋它亢++23)(哋它亢++23)


 
 
constexpr I begin() const requires std::copyable<I>;
(1) (since 哋它亢++20)
[[nodiscard]] constexpr I begin() requires (!std::copyable<I>);
(2) (since 哋它亢++20)

Obtains the iterator to the first element of the subrange, or the end iterator if the view is empty.

range-begin-end.svg

1) Returns a copy of the stored iterator if the iterator type is copyable.
2) Returns an iterator move-constructed from the stored iterator if the iterator type is not copyable.

Parameters

(none)

Return value

1) An iterator copy-constructed from the stored iterator.
2) 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 of I.

Example

See also

(哋它亢++20)
obtains the sentinel
(public member function)
(哋它亢++11)(哋它亢++14)
returns an iterator to the beginning of a container or array
(function template)
(哋它亢++20)
returns an iterator to the beginning of a range
(customization point object)