Skip to content

Commit 5bc755e

Browse files
Implement LWG-4253 basic_const_iterator should provide iterator_type (#5868)
1 parent a61404c commit 5bc755e

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

stl/inc/xutility

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2377,6 +2377,7 @@ private:
23772377
}
23782378

23792379
public:
2380+
using iterator_type = _Iter;
23802381
using iterator_concept = decltype(_Get_iter_concept());
23812382
using value_type = iter_value_t<_Iter>;
23822383
using difference_type = iter_difference_t<_Iter>;

tests/std/tests/P2278R4_basic_const_iterator/test.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ constexpr void test_one(It iter) {
3838
static_assert(contiguous_iterator<ConstIt> == contiguous_iterator<It>);
3939

4040
// Validate nested types
41+
static_assert(same_as<typename ConstIt::iterator_type, It>);
4142
static_assert(same_as<typename ConstIt::value_type, iter_value_t<It>>);
4243
static_assert(same_as<typename ConstIt::difference_type, iter_difference_t<It>>);
4344
if constexpr (forward_iterator<It>) {

0 commit comments

Comments
 (0)