BDE 4.14.0 Production release
Loading...
Searching...
No Matches
bslstl_randomaccessiterator.h
Go to the documentation of this file.
1/// @file bslstl_randomaccessiterator.h
2///
3/// The content of this file has been pre-processed for Doxygen.
4///
5
6
7// bslstl_randomaccessiterator.h -*-C++-*-
8#ifndef INCLUDED_BSLSTL_RANDOMACCESSITERATOR
9#define INCLUDED_BSLSTL_RANDOMACCESSITERATOR
10
11#include <bsls_ident.h>
12BSLS_IDENT("$Id: $")
13
14/// @defgroup bslstl_randomaccessiterator bslstl_randomaccessiterator
15/// @brief Provide a template to create STL-compliant random access iterators.
16/// @addtogroup bsl
17/// @{
18/// @addtogroup bslstl
19/// @{
20/// @addtogroup bslstl_randomaccessiterator
21/// @{
22///
23/// <h1> Outline </h1>
24/// * <a href="#bslstl_randomaccessiterator-purpose"> Purpose</a>
25/// * <a href="#bslstl_randomaccessiterator-classes"> Classes </a>
26/// * <a href="#bslstl_randomaccessiterator-description"> Description </a>
27/// * <a href="#bslstl_randomaccessiterator-usage"> Usage </a>
28/// * <a href="#bslstl_randomaccessiterator-example-1-defining-a-standard-compliant-random-access-iterator"> Example 1: Defining a Standard Compliant Random Access Iterator </a>
29///
30/// # Purpose {#bslstl_randomaccessiterator-purpose}
31/// Provide a template to create STL-compliant random access iterators.
32///
33/// # Classes {#bslstl_randomaccessiterator-classes}
34///
35/// - bslstl::RandomAccessIterator: random-access iterator template
36///
37/// **Canonical header:** bsl_iterator.h
38///
39/// @see bslstl_iterator, bslstl_forwarditerator,
40/// bslstl_bidirectionaliterator
41///
42/// # Description {#bslstl_randomaccessiterator-description}
43/// This component provides an iterator adaptor that, given an
44/// implementation class defining a core set of iterator functionality specified
45/// in the class level documentation, adapts it to provide an STL-compliant
46/// random access iterator interface. `bslstl::RandomAccessIterator` meets the
47/// requirements of a random access iterator described in the C++11 standard
48/// [24.2.7] under the tag "[random.access.iterators]". Include bsl_iterator.h
49/// to use this component.
50///
51/// ## Usage {#bslstl_randomaccessiterator-usage}
52///
53///
54/// In this section we show intended use of this component.
55///
56/// ### Example 1: Defining a Standard Compliant Random Access Iterator {#bslstl_randomaccessiterator-example-1-defining-a-standard-compliant-random-access-iterator}
57///
58///
59/// Suppose we want to create a standard compliant random access iterator for a
60/// container.
61///
62/// First, we define an iterator, `MyArrayIterator`, that meets the requirements
63/// of the `IMP_ITER` template parameter of `RandomAccessIterator` class (see
64/// class level documentation), but does not meet the full set of requirements
65/// for a random access iterator as defined by the C++ standard. Note that the
66/// following shows only the public interface required. Private members and
67/// additional methods that may be needed to implement this class are elided in
68/// this example:
69/// @code
70/// template <class VALUE>
71/// class MyArrayIterator {
72/// // This class implements the minimal requirements to implement a random
73/// // access iterator using 'bslstl::RandomAccessIterator'.
74///
75/// public:
76/// // CREATORS
77/// MyArrayIterator();
78/// // Create a 'MyArrayIterator' object that does not refer to any
79/// // value.
80///
81/// MyArrayIterator(const MyArrayIterator& original);
82/// // Create a 'MyArrayIterator' object having the same value
83/// // as the specified 'original' object.
84///
85/// ~MyArrayIterator();
86/// // Destroy this object;
87///
88/// // MANIPULATORS
89/// MyArrayIterator& operator=(const MyArrayIterator& rhs);
90/// // Assign to this object the value of the specified 'rhs' object,
91/// // and return a reference providing modifiable access to this
92/// // object.
93///
94/// void operator++();
95/// // Increment this object to refer to the next element in an array.
96///
97/// void operator--();
98/// // Decrement this object to refer to the previous element in an
99/// // array.
100///
101/// void operator+=(std::ptrdiff_t n);
102/// // Move this object forward by the specified 'n' elements in the
103/// // array.
104///
105/// void operator-=(std::ptrdiff_t n);
106/// // Move this object backward by the specified 'n' elements in the
107/// // array.
108///
109/// // ACCESSORS
110/// VALUE& operator*() const;
111/// // Return a reference providing modifiable access to the value (of
112/// // the parameterized 'VALUE' type) of the element referred to by
113/// // this object.
114/// };
115///
116/// template <class VALUE>
117/// bool operator==(const MyArrayIterator<VALUE>&,
118/// const MyArrayIterator<VALUE>&);
119/// template <class VALUE>
120/// bool operator<(const MyArrayIterator<VALUE>&,
121/// const MyArrayIterator<VALUE>&);
122/// template <class VALUE>
123/// std::ptrdiff_t operator-(const MyArrayIterator<VALUE>&,
124/// const MyArrayIterator<VALUE>&);
125/// @endcode
126/// Notice that `MyArrayIterator` does not implement a complete standard
127/// compliant random access iterator. It is missing methods such as `operator+`
128/// and `operator[]`.
129///
130/// Then, we define the interface for our container class template,
131/// `MyFixedSizeArray`. The implementation of the interface is elided for
132/// brevity:
133/// @code
134/// template <class VALUE, int SIZE>
135/// class MyFixedSizeArray {
136/// // This class implements a container that contains the parameterized
137/// // 'SIZE' number of elements of the parameterized 'VALUE' type.
138///
139/// // DATA
140/// VALUE d_array[SIZE]; // storage of the container
141///
142/// public:
143/// // PUBLIC TYPES
144/// typedef VALUE value_type;
145/// @endcode
146/// Now, we use `RandomAccessIterator` to create a standard compliant iterator
147/// for this container:
148/// @code
149/// typedef bslstl::RandomAccessIterator<VALUE,
150/// MyArrayIterator<VALUE> > iterator;
151/// typedef bslstl::RandomAccessIterator<const VALUE,
152/// MyArrayIterator<VALUE> >
153/// const_iterator;
154/// @endcode
155/// Notice that the implementation for `const_iterator` is
156/// `MyArrayIterator<VALUE>` and *not* `MyArrayIterator<const VALUE>`.
157///
158/// Next, we continue defining the rest of the class.
159/// @code
160/// // CREATORS
161/// //! MyFixedSizeArray() = default;
162/// // Create a 'MyFixedSizeArray' object having the parameterized
163/// // 'SIZE' number of elements of the parameterized type 'VALUE'.
164///
165/// //! MyFixedSizeArray(const MyFixedSizeArray& original) = default;
166/// // Create a 'MyFixedSizeArray' object having same number of
167/// // elements as that of the specified 'original', the same value of
168/// // each element as that of corresponding element in 'original'.
169///
170/// //! ~MyFixedSizeArray() = default;
171/// // Destroy this object.
172///
173/// // MANIPULATORS
174/// iterator begin();
175/// // Return a random access iterator providing modifiable access to
176/// // the first valid element of this object.
177///
178/// iterator end();
179/// // Return a random access iterator providing modifiable access to
180/// // the last valid element of this object.
181///
182/// VALUE& operator[](std::ptrdiff_t position);
183/// // Return a reference providing modifiable access to the element at
184/// // the specified 'position'.
185///
186/// // ACCESSORS
187/// const_iterator begin() const;
188/// // Return a random access iterator providing non-modifiable access
189/// // to the first valid element of this object.
190///
191/// const_iterator end() const;
192/// // Return a random access iterator providing non-modifiable access
193/// // to the last valid element of this object.
194///
195/// const VALUE& operator[](std::ptrdiff_t position) const;
196/// // Return a reference providing non-modifiable access to the
197/// // specified 'i'th element in this object.
198/// };
199/// @endcode
200/// Then, we create a `MyFixedSizeArray` and initialize its elements:
201/// @code
202/// MyFixedSizeArray<int, 5> fixedArray;
203/// fixedArray[0] = 3;
204/// fixedArray[1] = 2;
205/// fixedArray[2] = 5;
206/// fixedArray[3] = 4;
207/// fixedArray[4] = 1;
208/// @endcode
209/// Finally, to show that `MyFixedSizeArray::iterator` can be used as a random
210/// access iterator, we invoke a function that takes random iterators as
211/// parameters, such as `std::sort`, on the `begin` and `end` iterators
212/// and verify the results:
213/// @code
214/// std::sort(fixedArray.begin(), fixedArray.end());
215///
216/// assert(fixedArray[0] == 1);
217/// assert(fixedArray[1] == 2);
218/// assert(fixedArray[2] == 3);
219/// assert(fixedArray[3] == 4);
220/// assert(fixedArray[4] == 5);
221/// @endcode
222/// @}
223/** @} */
224/** @} */
225
226/** @addtogroup bsl
227 * @{
228 */
229/** @addtogroup bslstl
230 * @{
231 */
232/** @addtogroup bslstl_randomaccessiterator
233 * @{
234 */
235
236#include <bslscm_version.h>
237
239#include <bslstl_iterator.h>
240
241#include <bslmf_removecv.h>
243
244#include <iterator>
245
246#include <cstddef> // 'ptrdiff_t'
247
248
249
250namespace bslstl {
251
252 //===========================
253 // class RandomAccessIterator
254 //===========================
255
256/// Given an `ITER_IMP` type that implements a minimal subset of an iterator
257/// interface, this template generates a complete iterator that meets all of
258/// the requirements of a "random-access iterator" in the C++ standard. If
259/// `T` is const-qualified, then the resulting type is a const iterator.
260/// `T` shall not be a function, reference type or void. `ITER_IMP` must
261/// provide public operations so that, for objects `i` and `j` of type
262/// `ITER_IMP` and `n` of an integral type, the following operations are
263/// supported:
264/// @code
265/// ITER_IMP i; default construction
266/// ITER_IMP j(i); copy construction
267/// i = j assignment
268/// ++i increment to next element
269/// --i decrement to previous element
270/// i += n increment by n elements
271/// i -= n decrement by n elements
272/// j - i // convertible to ptrdiff_t distance from i to j
273/// i == j // convertible to bool equality comparison
274/// i < j // convertible to bool less-than comparison
275/// *i // reference convertible to T& element access (dereference)
276/// @endcode
277template <class T, class ITER_IMP, class TAG_TYPE =
278 std::random_access_iterator_tag>
280 : public BidirectionalIterator<T,ITER_IMP, TAG_TYPE> {
281
282 // PRIVATE TYPES
283 typedef typename bsl::remove_cv<T>::type UnCvqT; // value type without
284 // 'const' and
285 // 'volatile'
286 // qualifications
287 public:
288 // TYPES
289 typedef UnCvqT value_type;
290 typedef std::ptrdiff_t difference_type;
291 typedef T *pointer;
292 typedef T& reference;
293 typedef std::random_access_iterator_tag iterator_category;
294
295 // CREATORS
296
297 /// Construct the default value for this iterator type. All default-
298 /// constructed `RandomAccessIterator` objects represent
299 /// non-dereferenceable iterators into the same empty range. They do
300 /// not have a singular value unless an object of the type specified by
301 /// the template parameter `ITER_IMP` has a singular value after
302 /// value-initialization.
304
305 /// Construct a random access iterator having the specified
306 /// `implementation` of the parameterized `ITER_IMP` type.
307 RandomAccessIterator(const ITER_IMP& implementation); // IMPLICIT
308
309 /// Construct a random access iterator from another (compatible)
310 /// `RandomAccessIterator` type, e.g., a mutable iterator of the same
311 /// type. Note that this constructor may be the copy constructor
312 /// (inhibiting the implicit declaration of a copy constructor above),
313 /// or may be an additional overload.
316
318 // Destroy this iterator. Note that this method's definition is
319 // compiler generated.
320
321 // MANIPULATORS
322
323 /// Copy the value of the specified `rhs` to this iterator. Return a
324 /// reference to this modifiable iterator.
327
328 /// Increment to the next element. Return a reference to this
329 /// modifiable iterator. The behavior is undefined if, on entry, this
330 /// iterator has the past-the-end value for an iterator over the
331 /// underlying sequence.
333
334 /// Decrement to the previous element. Return a reference to this
335 /// modifiable iterator. The behavior is undefined if, on entry, this
336 /// iterator has the same value as an iterator to the start of the
337 /// underlying sequence.
339
340 /// Increment by the specified `offset` number of elements. Return a
341 /// reference to this modifiable iterator. The behavior is undefined
342 /// unless the iterator, after incrementing by `offset`, is within the
343 /// bounds of the underlying sequence.
345
346 /// Decrement by the specified `offset` number of elements. Return a
347 /// reference to this modifiable iterator. The behavior is undefined
348 /// unless the iterator, after decrementing by `offset`, is within the
349 /// bounds of the underlying sequence.
351
352 // ACCESSORS
353
354 /// Return a reference to the element at the specified `index` positions
355 /// past the current one. The behavior is undefined unless the
356 /// referenced position lies within the underlying sequence. Note that
357 /// `index` may be negative.
358 T& operator[](difference_type index) const;
359};
360
361// FREE OPERATORS
362
363/// Return `true` if the specified `lhs` iterator has the same value as the
364/// specified `rhs` iterator, and `false` otherwise. Two iterators have the
365/// same value if they refer to the same element, or both have the past-the-
366/// end value for the underlying sequence. The behavior is undefined unless
367/// both iterators refer to the same underlying sequence.
368template <class T1, class T2, class ITER_IMP, class TAG_TYPE>
371
372/// Return `true` if the specified `lhs` iterator does not have the same
373/// value as the specified `rhs` iterator, and `false` otherwise. Two
374/// iterators do not have the same value if (1) they do not refer to the
375/// same element and (2) both do not have the past-the-end iterator value
376/// for the underlying sequence. The behavior is undefined unless both
377/// iterators refer to the same underlying sequence.
378template <class T1, class T2, class ITER_IMP, class TAG_TYPE>
381
382/// Increment the specified `iter` to next element. Return the previous
383/// value of `iter`. The behavior is undefined if, on entry, `iter` has the
384/// past-the-end value for an iterator of the underlying sequence.
385template <class T, class ITER_IMP, class TAG_TYPE>
388
389/// Decrement the specified `iter` to previous element. Return the previous
390/// value of `iter`. The behavior is undefined if, on entry, `iter` has the
391/// same value as an iterator to the start of the underlying sequence.
392template <class T, class ITER_IMP, class TAG_TYPE>
395
396/// Return an iterator to the element at the specified `rhs` positions past
397/// the specified `lhs`. The behavior is undefined unless `lhs`, after
398/// incrementing by `rhs`, is within the bounds of the underlying sequence.
399template <class T, class ITER_IMP, class TAG_TYPE>
402 std::ptrdiff_t rhs);
403
404/// Return an iterator to the element at the specified `lhs` positions past
405/// the specified `rhs`. The behavior is undefined unless `rhs`, after
406/// incrementing by `lhs`, is within the bounds of the underlying sequence.
407template <class T, class ITER_IMP, class TAG_TYPE>
409operator+(std::ptrdiff_t lhs,
411
412/// Return an iterator to the element at the specified `rhs` positions
413/// before the specified `lhs`. The behavior is undefined unless `lhs`,
414/// after decrementing by `rhs`, is within the bounds of the underlying
415/// sequence. Note that this function is logically equivalent to:
416/// @code
417/// iter + (-rhs)
418/// @endcode
419template <class T, class ITER_IMP, class TAG_TYPE>
422 std::ptrdiff_t rhs);
423
424/// Return the distance from the specified `rhs` iterator to the specified
425/// `lhs` iterator. The behavior is undefined unless `lhs` and `rhs` are
426/// iterators into the same underlying sequence. Note that the result might
427/// be negative.
428template <class T1, class T2, class ITER_IMP, class TAG_TYPE>
429std::ptrdiff_t
432
433/// Return `true` if (1) the specified `lhs` iterator refers to an element
434/// before the specified `rhs` iterator in the iteration sequence, or (2)
435/// `rhs` (and not `lhs`) has the past-the-end value for an iterator over
436/// this sequence, and `false` otherwise. The behavior is undefined unless
437/// `lhs` and `rhs` are iterators into the same underlying sequence.
438template <class T1, class T2, class ITER_IMP, class TAG_TYPE>
441
442/// Return `true` if (1) the specified `lhs` iterator refers to an element
443/// after the specified `rhs` iterator in the iteration sequence, or (2)
444/// `lhs` (and not `rhs`) has the past-the-end value for an iterator over
445/// this sequence, and `false` otherwise. The behavior is undefined unless
446/// `lhs` and `rhs` are iterators into the same underlying sequence.
447template <class T1, class T2, class ITER_IMP, class TAG_TYPE>
450
451/// Return `true` if (1) the specified `lhs` iterator has the same value as
452/// the specified `rhs` iterator, or (2) `lhs` refers to an element before
453/// `rhs` in the iteration sequence, or (3) `rhs` has the past-the-end value
454/// for an iterator over this sequence, and `false` otherwise. The behavior
455/// is undefined unless `lhs` and `rhs` are iterators into the same
456/// underlying sequence.
457template <class T1, class T2, class ITER_IMP, class TAG_TYPE>
460
461/// Return `true` if (1) the specified `lhs` iterator has the same value as
462/// the specified `rhs` iterator, or (2) `lhs` has the past-the-end value
463/// for an iterator over this sequence, or (3) `lhs` refers to an element
464/// after `rhs` in the iteration sequence, and `false` otherwise. The
465/// behavior is undefined unless `lhs` and `rhs` are iterators into the same
466/// underlying sequence.
467template <class T1, class T2, class ITER_IMP, class TAG_TYPE>
470
471// ============================================================================
472// INLINE FUNCTION DEFINITIONS
473// ============================================================================
474
475 //----------------------------------
476 // class RandomAccessIterator
477 //----------------------------------
478
479// CREATORS
480template <class T, class ITER_IMP, class TAG_TYPE>
481inline
485
486template <class T, class ITER_IMP, class TAG_TYPE>
487inline
489RandomAccessIterator(const ITER_IMP& implementation)
490: BidirectionalIterator<T,ITER_IMP,TAG_TYPE>(implementation)
491{
492}
493
494template <class T, class ITER_IMP, class TAG_TYPE>
495inline
502
503// MANIPULATORS
504template <class T, class ITER_IMP, class TAG_TYPE>
505inline
509{
510 this->imp() = other.imp();
511 return *this;
512}
513
514template <class T, class ITER_IMP, class TAG_TYPE>
515inline
518{
519 ++this->imp();
520 return *this;
521}
522
523template <class T, class ITER_IMP, class TAG_TYPE>
524inline
527{
528 --this->imp();
529 return *this;
530}
531
532template <class T, class ITER_IMP, class TAG_TYPE>
533inline
536{
537 this->imp() += offset;
538 return *this;
539}
540
541template <class T, class ITER_IMP, class TAG_TYPE>
542inline
545{
546 this->imp() += -offset;
547 return *this;
548}
549
550// ACCESSORS
551template <class T, class ITER_IMP, class TAG_TYPE>
552inline
554 difference_type index) const
555{
557 tmp += index;
558 return *tmp;
559}
560
561} // close package namespace
562
563// FREE OPERATORS
564template <class T1, class T2, class ITER_IMP, class TAG_TYPE>
565inline
566bool bslstl::operator==(const RandomAccessIterator<T1,ITER_IMP,TAG_TYPE>& lhs,
567 const RandomAccessIterator<T2,ITER_IMP,TAG_TYPE>& rhs)
568{
569 return lhs.imp() == rhs.imp();
570}
571
572template <class T1, class T2, class ITER_IMP, class TAG_TYPE>
573inline
574bool bslstl::operator!=(const RandomAccessIterator<T1,ITER_IMP,TAG_TYPE>& lhs,
575 const RandomAccessIterator<T2,ITER_IMP,TAG_TYPE>& rhs)
576{
577 return !(lhs == rhs);
578}
579
580template <class T, class ITER_IMP, class TAG_TYPE>
581inline
583bslstl::operator++(RandomAccessIterator<T,ITER_IMP,TAG_TYPE>& iter, int)
584{
585 RandomAccessIterator<T,ITER_IMP,TAG_TYPE> tmp(iter);
586 ++iter;
587 return tmp;
588}
589
590template <class T, class ITER_IMP, class TAG_TYPE>
591inline
593bslstl::operator--(RandomAccessIterator<T,ITER_IMP,TAG_TYPE>& iter, int)
594{
595 RandomAccessIterator<T,ITER_IMP,TAG_TYPE> tmp(iter);
596 --iter;
597 return tmp;
598}
599
600template <class T, class ITER_IMP, class TAG_TYPE>
601inline
603bslstl::operator+(const RandomAccessIterator<T,ITER_IMP,TAG_TYPE>& lhs,
604 std::ptrdiff_t rhs)
605{
606 RandomAccessIterator<T,ITER_IMP,TAG_TYPE> result(lhs);
607 result += rhs;
608 return result;
609}
610
611template <class T, class ITER_IMP, class TAG_TYPE>
612inline
614bslstl::operator+(std::ptrdiff_t lhs,
615 const RandomAccessIterator<T,ITER_IMP,TAG_TYPE>& rhs)
616{
617 return rhs + lhs;
618}
619
620template <class T, class ITER_IMP, class TAG_TYPE>
621inline
623bslstl::operator-(const RandomAccessIterator<T,ITER_IMP,TAG_TYPE>& lhs,
624 std::ptrdiff_t rhs)
625{
626 return lhs + -rhs;
627}
628
629template <class T1, class T2, class ITER_IMP, class TAG_TYPE>
630inline
631std::ptrdiff_t bslstl::operator-(
632 const RandomAccessIterator<T1,ITER_IMP,TAG_TYPE>& lhs,
633 const RandomAccessIterator<T2,ITER_IMP,TAG_TYPE>& rhs)
634{
635 return lhs.imp() - rhs.imp();
636}
637
638template <class T1, class T2, class ITER_IMP, class TAG_TYPE>
639inline
640bool bslstl::operator<(const RandomAccessIterator<T1,ITER_IMP,TAG_TYPE>& lhs,
641 const RandomAccessIterator<T2,ITER_IMP,TAG_TYPE>& rhs)
642{
643 return lhs.imp() < rhs.imp();
644}
645
646template <class T1, class T2, class ITER_IMP, class TAG_TYPE>
647inline
648bool bslstl::operator>(const RandomAccessIterator<T1,ITER_IMP,TAG_TYPE>& lhs,
649 const RandomAccessIterator<T2,ITER_IMP,TAG_TYPE>& rhs)
650{
651 return rhs < lhs;
652}
653
654template <class T1, class T2, class ITER_IMP, class TAG_TYPE>
655inline
656bool bslstl::operator<=(const RandomAccessIterator<T1,ITER_IMP,TAG_TYPE>& lhs,
657 const RandomAccessIterator<T2,ITER_IMP,TAG_TYPE>& rhs)
658{
659 return !(rhs < lhs);
660}
661
662template <class T1, class T2, class ITER_IMP, class TAG_TYPE>
663inline
664bool bslstl::operator>=(const RandomAccessIterator<T1,ITER_IMP,TAG_TYPE>& lhs,
665 const RandomAccessIterator<T2,ITER_IMP,TAG_TYPE>& rhs)
666{
667 return !(lhs < rhs);
668}
669
670#ifndef BDE_OPENSOURCE_PUBLICATION // BACKWARD_COMPATIBILITY
671// ============================================================================
672// BACKWARD COMPATIBILITY
673// ============================================================================
674
675#ifdef bslstl_RandomAccessIterator
676#undef bslstl_RandomAccessIterator
677#endif
678/// This alias is defined for backward compatibility.
679#define bslstl_RandomAccessIterator bslstl::RandomAccessIterator
680#endif // BDE_OPENSOURCE_PUBLICATION -- BACKWARD_COMPATIBILITY
681
682
683
684#endif
685
686// ----------------------------------------------------------------------------
687// Copyright 2013 Bloomberg Finance L.P.
688//
689// Licensed under the Apache License, Version 2.0 (the "License");
690// you may not use this file except in compliance with the License.
691// You may obtain a copy of the License at
692//
693// http://www.apache.org/licenses/LICENSE-2.0
694//
695// Unless required by applicable law or agreed to in writing, software
696// distributed under the License is distributed on an "AS IS" BASIS,
697// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
698// See the License for the specific language governing permissions and
699// limitations under the License.
700// ----------------------------- END-OF-FILE ----------------------------------
701
702/** @} */
703/** @} */
704/** @} */
Definition bslstl_bidirectionaliterator.h:266
ITER_IMP & imp()
Return a modifiable reference to the implementation object.
Definition bslstl_forwarditerator.h:353
Definition bslstl_randomaccessiterator.h:280
std::ptrdiff_t difference_type
Definition bslstl_randomaccessiterator.h:290
RandomAccessIterator & operator++()
Definition bslstl_randomaccessiterator.h:517
std::random_access_iterator_tag iterator_category
Definition bslstl_randomaccessiterator.h:293
T & operator[](difference_type index) const
Definition bslstl_randomaccessiterator.h:553
RandomAccessIterator & operator=(const RandomAccessIterator< UnCvqT, ITER_IMP, TAG_TYPE > &other)
Definition bslstl_randomaccessiterator.h:507
RandomAccessIterator & operator-=(difference_type offset)
Definition bslstl_randomaccessiterator.h:544
UnCvqT value_type
Definition bslstl_randomaccessiterator.h:289
T & reference
Definition bslstl_randomaccessiterator.h:292
T * pointer
Definition bslstl_randomaccessiterator.h:291
RandomAccessIterator & operator+=(difference_type offset)
Definition bslstl_randomaccessiterator.h:535
RandomAccessIterator()
Definition bslstl_randomaccessiterator.h:482
RandomAccessIterator & operator--()
Definition bslstl_randomaccessiterator.h:526
#define BSLS_IDENT(str)
Definition bsls_ident.h:195
Definition bslstl_algorithm.h:82
bool operator>=(const RandomAccessIterator< T1, ITER_IMP, TAG_TYPE > &lhs, const RandomAccessIterator< T2, ITER_IMP, TAG_TYPE > &rhs)
RandomAccessIterator< T, ITER_IMP, TAG_TYPE > operator-(const RandomAccessIterator< T, ITER_IMP, TAG_TYPE > &lhs, std::ptrdiff_t rhs)
bool operator<(const RandomAccessIterator< T1, ITER_IMP, TAG_TYPE > &lhs, const RandomAccessIterator< T2, ITER_IMP, TAG_TYPE > &rhs)
BidirectionalIterator< T, ITER_IMP, TAG_TYPE > operator--(BidirectionalIterator< T, ITER_IMP, TAG_TYPE > &iter, int)
bool operator<=(const RandomAccessIterator< T1, ITER_IMP, TAG_TYPE > &lhs, const RandomAccessIterator< T2, ITER_IMP, TAG_TYPE > &rhs)
BidirectionalIterator< T, ITER_IMP, TAG_TYPE > operator++(BidirectionalIterator< T, ITER_IMP, TAG_TYPE > &iter, int)
bool operator==(const BidirectionalIterator< T1, ITER_IMP, TAG_TYPE > &lhs, const BidirectionalIterator< T2, ITER_IMP, TAG_TYPE > &rhs)
RandomAccessIterator< T, ITER_IMP, TAG_TYPE > operator+(const RandomAccessIterator< T, ITER_IMP, TAG_TYPE > &lhs, std::ptrdiff_t rhs)
bool operator>(const RandomAccessIterator< T1, ITER_IMP, TAG_TYPE > &lhs, const RandomAccessIterator< T2, ITER_IMP, TAG_TYPE > &rhs)
bool operator!=(const BidirectionalIterator< T1, ITER_IMP, TAG_TYPE > &lhs, const BidirectionalIterator< T2, ITER_IMP, TAG_TYPE > &rhs)
remove_const< typenameremove_volatile< t_TYPE >::type >::type type
Definition bslmf_removecv.h:126