Namespaces
Variants
Views
Actions

std::basic_const_iterator<Iter>::operator constant-iterator

From cppreference.com
 
 
Iterator library
Iterator concepts
Iterator primitives
Algorithm concepts and utilities
Indirect callable concepts
Common algorithm requirements
(C++20)
(C++20)
(C++20)
Utilities
(C++20)
Iterator adaptors
Range access
(C++11)(C++14)
(C++14)(C++14)  
(C++11)(C++14)
(C++14)(C++14)  
(C++17)(C++20)
(C++17)
(C++17)
 
 
template< /*not-a-const-iterator*/ CI >

  requires /*constant-iterator*/<CI> &&
      std::convertible_to<Iter const&, CI>

constexpr operator CI() const &;
(1) (since C++23)
template< /*not-a-const-iterator*/ CI >

  requires /*constant-iterator*/<CI> &&
      std::convertible_to<Iter, CI>

constexpr operator CI() &&;
(2) (since C++23)

Returns the converted constant iterator to which an underlying iterator current can be explicitly or implicitly convertible.

CI satisfies the exposition-only concept /*not-a-const-iterator*/ if and only if it's not a specialization of basic_const_iterator.

[edit] Return value

1) current
2) std::move(current)

[edit] Example

[edit] Defect reports

The following behavior-changing defect reports were applied retroactively to previously published C++ standards.

DR Applied to Behavior as published Correct behavior
P2836R1 C++23 basic_const_iterator doesn't follow its underlying type's convertibility conversion operator provided