[ Web Proxy ]
URL:
Viewing: https://en.cppreference.com/cpp/ranges/view_interface/cbegin [Back]  [Original]

std::ranges::view_interface<D>::cbegin - cppreference.com
cppreference.com
Namespaces
Variants

std::ranges::view_interface<D>::cbegin

From cppreference.com
 
 
Ranges library
Range adaptors
 
 
constexpr auto cbegin();
(1) (since C++23)
constexpr auto cbegin() const requires ranges::range<const D>;
(2) (since C++23)

The default implementation of cbegin() member function returns a constant beginning iterator of the range.

1) Let derived be a reference bound to static_cast<D&>(*this).
Equivalent to return ranges::cbegin(derived);.
2) Same as (1), except that derived is static_cast<const D&>(*this).

Return value

A constant beginning iterator of the range.

Notes

All range adaptors and range factories in the standard library and std::ranges::subrange use the default implementation of cbegin.

Feature-test macro Value Std Feature
__cpp_lib_ranges_as_const 202207L (C++23) Rectifying constant iterators, sentinels, and ranges. ranges::view_interface::cbegin() and ranges::view_interface::cend()

Example

See also

(C++11)(C++14)
returns an iterator to the beginning of a container or array
(function template) [edit]
returns an iterator to the beginning of a read-only range
(customization point object)[edit]

Web Proxy Viewer  |  New URL  |  Original Page