[counted.iter.const] # 24 Iterators library [[iterators]](./#iterators) ## 24.5 Iterator adaptors [[predef.iterators]](predef.iterators#counted.iter.const) ### 24.5.7 Counted iterators [[iterators.counted]](iterators.counted#counted.iter.const) #### 24.5.7.2 Constructors and conversions [counted.iter.const] [🔗](#lib:counted_iterator,constructor) `constexpr counted_iterator(I i, iter_difference_t n); ` [1](#1) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iterators.tex#L6013) *Hardened preconditions*: n >= 0 is true[.](#1.sentence-1) [2](#2) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iterators.tex#L6017) *Effects*: Initializes current with std​::​move(i) andlength with n[.](#2.sentence-1) [🔗](#lib:counted_iterator,constructor_) `template requires [convertible_to](concept.convertible#concept:convertible_to "18.4.4 Concept convertible_­to [concept.convertible]") constexpr counted_iterator(const counted_iterator& x); ` [3](#3) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iterators.tex#L6031) *Effects*: Initializes current with x.current andlength with x.length[.](#3.sentence-1) [🔗](#lib:operator=,counted_iterator) `template requires [assignable_from](concept.assignable#concept:assignable_from "18.4.8 Concept assignable_­from [concept.assignable]") constexpr counted_iterator& operator=(const counted_iterator& x); ` [4](#4) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iterators.tex#L6045) *Effects*: Assigns x.current to current andx.length to length[.](#4.sentence-1) [5](#5) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iterators.tex#L6050) *Returns*: *this[.](#5.sentence-1)