std::ranges::range_reference_t, std::ranges::range_const_reference_t, std::ranges::range_rvalue_reference_t, std::ranges::range_common_reference_t
From cppreference.com
C++
Feature test macros (C++20)
Concepts library (C++20)
Metaprogramming library (C++11)
Ranges library (C++20)
Filesystem library (C++17)
Concurrency support library (C++11)
Execution control library (C++26)
Ranges library
computes the associated types of an iterator
(alias template)[edit]
(C++23)(C++23)
range_reference_trange_const_reference_trange_rvalue_reference_trange_common_reference_t
(C++23)
(C++23)(C++23)
(C++23)(C++23)
(C++26)(C++26)
(C++23)(C++23)
(C++23)(C++23)
(C++23)(C++23)
(C++23)(C++23)
(C++23)(C++23)
(C++23)
(C++23)(C++23)
(C++23)
(C++23)(C++23)
(C++23)(C++23)
(C++23)(C++23)
(C++23)(C++23)
(C++23)(C++23)
(C++23)
Defined in header
<ranges>
template< ranges::range R >
using range_reference_t = std::iter_reference_t <ranges::iterator_t <R>>;
(1)
(since C++20)
using range_reference_t = std::iter_reference_t <ranges::iterator_t <R>>;
template< ranges::range R >
(2)
(since C++23)
using range_const_reference_t =
template< ranges::range R >
(3)
(since C++20)
using range_rvalue_reference_t =
template< ranges::range R >
(4)
(since C++20)
using range_common_reference_t =
1) Used to obtain the reference type of the iterator type of range type
R
.2) Used to obtain the constant reference type of the iterator type of range type
R
.3) Used to obtain the rvalue reference type of the iterator type of range type
R
.4) Used to obtain the common reference type of the iterator type of range type
R
.[edit] Template parameters
R
-
a
range
type or a sized_range
type
[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 |
---|---|---|---|
LWG 3860 | C++20 | range_common_reference_t was missing
|
added |
[edit] See also
(C++20)(C++20)(C++23)(C++20)(C++20)(C++20)
(alias template)[edit]