Choreonoid  1.8
Deque2D.h
Go to the documentation of this file.
1 
6 #ifndef CNOID_UTIL_DEQUE_2D_H
7 #define CNOID_UTIL_DEQUE_2D_H
8 
9 #include <memory>
10 #include <iterator>
11 
12 namespace cnoid {
13 
14 template <typename ElementType, typename Allocator = std::allocator<ElementType>>
15 class Deque2D
16 {
18 
19 public:
20  typedef ElementType value_type;
21  typedef ElementType Element;
22 
23  class const_iterator : public std::iterator<std::random_access_iterator_tag, ElementType> {
24 
25  friend class Deque2D<ElementType, Allocator>;
26 
27  protected:
28  ElementType* current;
29  ElementType* term;
30  ElementType* buf;
31 
32  const_iterator(const Deque2DType& owner, ElementType* pos) {
33  current = pos;
34  buf = owner.buf;
35  term = buf + owner.capacity_;
36  }
37 
38  public:
40 
42  current = org.current;
43  term = org.term;
44  buf = org.buf;
45  }
46 
47  const Element& operator*() const {
48  return *current;
49  }
51  ++current;
52  if(current == term){
53  current = buf;
54  }
55  return *this;
56  }
58  if(current == buf){
59  current = term - 1;
60  } else {
61  --current;
62  }
63  }
65  current += n;
66  if(current >= term){
67  current = buf + (current - term);
68  }
69  return *this;
70  }
72  current -= n;
73  if(current < buf){
74  current = term - (buf - current);
75  }
76  return *this;
77  }
79  const_iterator iter(*this);
80  iter += n;
81  return iter;
82  }
84  const_iterator iter(*this);
85  iter -= n;
86  return iter;
87  }
88  bool operator==(const const_iterator& rhs) const {
89  return (current == rhs.current);
90  }
91  bool operator!=(const const_iterator& rhs) const {
92  return (current != rhs.current);
93  }
94  bool operator<(const const_iterator& rhs) const{
95  return current < rhs.current;
96  }
97  };
98 
99  class iterator : public const_iterator {
100 
101  friend class Deque2D<ElementType, Allocator>;
102 
103  iterator(Deque2DType& owner, ElementType* pos) : const_iterator(owner, pos) { }
104 
105  public:
106  iterator() { }
107  iterator(const iterator& org) : const_iterator(org) { }
108 
110  return *const_iterator::current;
111  }
112  iterator& operator+=(size_t n){
116  }
117  return *this;
118  }
119  iterator& operator-=(size_t n){
123  }
124  return *this;
125  }
126  iterator operator+(size_t n){
127  iterator iter(*this);
128  iter += n;
129  return iter;
130  }
131  iterator operator-(size_t n){
132  iterator iter(*this);
133  iter -= n;
134  return iter;
135  }
136  };
137 
138  iterator begin() {
139  return iterator(*this, buf + offset);
140  }
141 
142  const_iterator cbegin() const {
143  return const_iterator(*this, buf + offset);
144  }
145 
146  iterator end() {
147  return end_;
148  }
149 
150  const_iterator cend() const {
151  return end_;
152  }
153 
154  class Row
155  {
156  ElementType* top;
157  int size_;
158 
159  public:
160  Row() {
161  size_ = 0;
162  }
163 
164  Row(const Deque2D<ElementType, Allocator>& owner, int rowIndex) {
165  size_ = owner.colSize_;
166  top = owner.buf;
167  if(owner.capacity_ > 0){
168  top += (owner.offset + rowIndex * owner.colSize_) % owner.capacity_;
169  }
170  }
171 
172  bool empty() const {
173  return (size_ == 0);
174  }
175 
176  int size() const {
177  return size_;
178  }
179 
180  Element& operator[](int index){
181  return top[index];
182  }
183 
184  const Element& operator[](int index) const {
185  return top[index];
186  }
187 
188  Element& at(int index) {
189  return top[index];
190  }
191 
193  return top;
194  }
195 
197  return top + size_;
198  }
199  };
200 
201  class Column
202  {
203  public:
204  Column() {
205  colSize = 0;
206  rowSize = 0;
207  }
208 
210  top = owner.buf + column;
211  offset = owner.offset;
212  colSize = owner.colSize_;
213  capacity = owner.capacity_;
214  rowSize = owner.rowSize_;
215  end_ = iterator(*this, top + ((owner.capacity_ > 0) ? ((offset + owner.size_) % owner.capacity_) : 0));
216  }
217 
218  bool empty() const {
219  return (rowSize == 0);
220  }
221 
222  int size() const {
223  return rowSize;
224  }
225 
226  Element& operator[](int rowIndex){
227  return top[(offset + rowIndex * colSize) % capacity];
228  }
229 
230  const Element& operator[](int rowIndex) const {
231  return top[(offset + rowIndex * colSize) % capacity];
232  }
233 
234  Element& at(int index) {
235  return top[index * colSize];
236  }
237 
238  class iterator : public std::iterator<std::bidirectional_iterator_tag, ElementType, int> {
239 
240  ElementType* current;
241  ElementType* term;
242  ElementType* top;
243  int colSize;
244 
245  public:
246 
247  iterator() { }
248 
250  current = pos;
251  top = column.top;
252  term = top + column.capacity;
253  colSize = column.colSize;
254  }
256  return *current;
257  }
258  void operator++() {
259  current += colSize;
260  if(current == term){
261  current = top;
262  }
263  }
264  void operator--() {
265  if(current == top){
266  current = term - colSize;
267  } else {
268  current -= colSize;
269  }
270  }
271  bool operator==(iterator rhs) const {
272  return (current == rhs.current);
273  }
274  bool operator!=(iterator rhs) const {
275  return (current != rhs.current);
276  }
277  };
278 
280  return iterator(*this, top + offset);
281  }
283  return end_;
284  }
285 
286  private:
287  ElementType* top;
288  int offset;
289  int colSize;
290  int capacity;
291  int rowSize;
292  typename Column::iterator end_;
293  };
294 
296  buf = 0;
297  offset = 0;
298  rowSize_ = 0;
299  colSize_ = 0;
300  capacity_ = 0;
301  size_ = 0;
302  }
303 
304  Deque2D(int rowSize, int colSize) {
305 
306  buf = 0;
307  offset = 0;
308  rowSize_ = 0;
309  colSize_ = 0;
310  capacity_ = 0;
311  size_ = 0;
312 
313  resizeMain(rowSize, colSize, false);
314  }
315 
317  : allocator(org.allocator) {
318 
319  size_ = org.size_;
320  rowSize_ = org.rowSize_;
321  colSize_ = org.colSize_;
322  capacity_ = size_ + colSize_;
323  buf = 0;
324 
325  if(capacity_){
326  buf = allocator.allocate(capacity_);
327  offset = 0;
328  ElementType* p = buf;
329  ElementType* pend = buf + size_;
330  ElementType* q = org.buf + org.offset;
331  ElementType* qterm = org.buf + org.capacity_;
332  while(p != pend){
333  allocator.construct(p++, *q++);
334  if(q == qterm){
335  q = org.buf;
336  }
337  }
338  }
339  end_ = iterator(*this, buf + ((capacity_ > 0) ? ((offset + size_) % capacity_) : 0));
340  }
341 
343  if(this != &rhs){
344  resizeMain(rhs.rowSize_, rhs.colSize_, false);
345  iterator p = begin();
346  const_iterator q = rhs.cbegin();
347  const_iterator qend = rhs.cend();
348  while(q != qend){
349  *p = *q;
350  ++p;
351  ++q;
352  }
353  }
354  return *this;
355  }
356 
357  virtual ~Deque2D() {
358  if(buf){
359  ElementType* p = buf + offset;
360  const ElementType* pend = buf + (offset + size_) % capacity_;
361 
362  if(p <= pend){
363  while(p != pend){
364  allocator.destroy(p++);
365  }
366  } else {
367  for(ElementType* q = buf; q != pend; ++q){
368  allocator.destroy(q);
369  }
370  const ElementType* pterm = buf + capacity_;
371  for(ElementType* q = p; q != pterm; ++q){
372  allocator.destroy(q);
373  }
374  }
375  allocator.deallocate(buf, capacity_);
376  }
377  }
378 
379  bool empty() const {
380  return !rowSize_ || !colSize_;
381  }
382 
383 private:
384  void reallocMemory(int newColSize, int newSize, int newCapacity, bool doCopy) {
385 
386  ElementType* newBuf;
387  if(newCapacity > 0){
388  newBuf = allocator.allocate(newCapacity);
389  } else {
390  newBuf = 0;
391  }
392  ElementType* p = newBuf;
393  ElementType* pend = newBuf + newSize;
394 
395  if(capacity_ > 0){
396  ElementType* qend = buf + (offset + size_) % capacity_;
397 
398  // copy the existing elements
399  if(newCapacity > 0 && newColSize == colSize_ && doCopy){
400  ElementType* q = buf + offset;
401  if(q <= qend){
402  while(q != qend && p != pend){
403  allocator.construct(p++, *q++);
404  }
405  } else {
406  for(ElementType* r = buf; r != qend && p != pend; ++r){
407  allocator.construct(p++, *r);
408  }
409  ElementType* qterm = buf + capacity_;
410  for(ElementType* r = q; r != qterm && p != pend; ++r){
411  allocator.construct(p++, *r);
412  }
413  }
414  }
415  // destory the old elements
416  ElementType* q = buf + offset;
417  if(q <= qend){
418  while(q != qend){
419  allocator.destroy(q++);
420  }
421  } else {
422  for(ElementType* r = buf; r != qend; ++r){
423  allocator.destroy(r);
424  }
425  ElementType* qterm = buf + capacity_;
426  for(ElementType* r = q; r != qterm; ++r){
427  allocator.destroy(r);
428  }
429  }
430  }
431 
432  // construct new elements
433  while(p != pend){
434  allocator.construct(p++, ElementType());
435  }
436 
437  if(buf){
438  allocator.deallocate(buf, capacity_);
439  }
440  buf = newBuf;
441  capacity_ = newCapacity;
442  offset = 0;
443  }
444 
445  void resizeMain(int newRowSize, int newColSize, bool doCopy) {
446 
447  const int newSize = newRowSize * newColSize;
448 
449  if(newSize == 0){
450  reallocMemory(newColSize, newSize, 0, false);
451 
452  } else {
453  // The area for the 'end' iterator should be reserved
454  const int minCapacity = newSize + newColSize;
455 
456  if(capacity_ > 0 && minCapacity <= capacity_){
457  if(newColSize != colSize_ && (capacity_ % newColSize > 0)){
458  reallocMemory(newColSize, newSize, capacity_ - (capacity_ % newColSize), doCopy);
459 
460  } else if(newSize > size_){
461  ElementType* p = buf + (offset + size_) % capacity_;
462  const ElementType* pend = buf + (offset + newSize) % capacity_;
463  if(p <= pend){
464  while(p != pend){
465  allocator.construct(p++, ElementType());
466  }
467  } else {
468  for(ElementType* r = buf; r != pend; ++r){
469  allocator.construct(r, ElementType());
470  }
471  const ElementType* pterm = buf + capacity_;
472  for(ElementType* r = p; r != pterm; ++r){
473  allocator.construct(r, ElementType());
474  }
475  }
476  } else if(newSize < size_){
477  ElementType* p = buf + (offset + newSize) % capacity_;
478  ElementType* pend = buf + (offset + size_) % capacity_;
479  if(p <= pend){
480  while(p != pend){
481  allocator.destroy(p++);
482  }
483  } else {
484  for(ElementType* r = buf; r != pend; ++r){
485  allocator.destroy(r);
486  }
487  const ElementType* pterm = buf + capacity_;
488  for(ElementType* r = p; r != pterm; ++r){
489  allocator.destroy(r);
490  }
491  }
492  }
493  } else {
494  if(!buf){
495  capacity_ = minCapacity;
496  if(capacity_ > 0){
497  buf = allocator.allocate(minCapacity);
498  ElementType* p = buf;
499  ElementType* pend = buf + newSize;
500  // construct new elements
501  while(p != pend){
502  allocator.construct(p++, ElementType());
503  }
504  }
505  } else {
506  int newCapacity;
507  const int expandedSize = size_ * 3 / 2;
508  if(expandedSize > newSize){
509  newCapacity = expandedSize - (expandedSize % newColSize) + newColSize;
510  } else {
511  newCapacity = minCapacity;
512  }
513  reallocMemory(newColSize, newSize, newCapacity, doCopy);
514  }
515  }
516  }
517 
518  rowSize_ = newRowSize;
519  colSize_ = newColSize;
520  size_ = newSize;
521  end_ = iterator(*this, buf + ((capacity_ > 0) ? ((offset + size_) % capacity_) : 0));
522  }
523 
524 public:
525  void resize(int newRowSize, int newColSize) {
526  resizeMain(newRowSize, newColSize, true);
527  }
528 
529  void resizeColumn(int newColSize){
530  resize(rowSize_, newColSize);
531  }
532 
533  int rowSize() const {
534  return rowSize_;
535  }
536 
540  void resizeRow(int newRowSize){
541  resize(newRowSize, colSize_);
542  }
543 
544  int colSize() const {
545  return colSize_;
546  }
547 
548  void clear() {
549  resize(0, 0);
550  }
551 
552  const Element& operator()(int rowIndex, int colIndex) const {
553  return buf[(offset + (rowIndex * colSize_)) % capacity_ + colIndex];
554  }
555 
556  Element& operator()(int rowIndex, int colIndex) {
557  return buf[(offset + (rowIndex * colSize_)) % capacity_ + colIndex];
558  }
559 
560  const Element& at(int rowIndex, int colIndex) const {
561  return buf[(offset + (rowIndex * colSize_)) % capacity_ + colIndex];
562  }
563 
564  Element& at(int rowIndex, int colIndex) {
565  return buf[(offset + (rowIndex * colSize_)) % capacity_ + colIndex];
566  }
567 
568  Row operator[](int rowIndex) {
569  return Row(*this, rowIndex);
570  }
571 
572  const Row operator[](int rowIndex) const {
573  return Row(*this, rowIndex);
574  }
575 
576  Row row(int rowIndex) {
577  return Row(*this, rowIndex);
578  }
579 
580  const Row row(int rowIndex) const {
581  return Row(*this, rowIndex);
582  }
583 
584  Row last() {
585  return Row(*this, rowSize_ - 1);
586  }
587 
588  const Row last() const {
589  return Row(*this, rowSize_ - 1);
590  }
591 
592  Column column(int colIndex) {
593  return Column(*this, colIndex);
594  }
595 
596  const Column column(int colIndex) const {
597  return Column(*this, colIndex);
598  }
599 
600  Row append() {
601  resize(rowSize_ + 1, colSize_);
602  return Row(*this, rowSize_ - 1);
603  }
604 
605  void pop_back() {
606  resize(rowSize_ - 1, colSize_);
607  }
608 
609  void pop_front(int numRows = 1) {
610  if(numRows <= 0){
611  return;
612  }
613  if(numRows > rowSize_){
614  numRows = rowSize_;
615  }
616  const size_t popSize = numRows * colSize_;
617  ElementType* p = buf + offset;
618  const ElementType* pend = buf + (offset + popSize) % capacity_;
619 
620  if(p <= pend){
621  while(p != pend){
622  allocator.destroy(p++);
623  }
624  } else {
625  for(ElementType* r = buf; r != pend; ++r){
626  allocator.destroy(r);
627  }
628  const ElementType* pterm = buf + capacity_;
629  for(ElementType* r = p; r != pterm; ++r){
630  allocator.destroy(r);
631  }
632  }
633  offset = (offset + popSize) % capacity_;
634  rowSize_ -= numRows;
635  size_ -= popSize;
636  }
637 
638 private:
639  Allocator allocator;
640  ElementType* buf;
641  int offset;
642  int rowSize_;
643  int colSize_;
644  int capacity_;
645  int size_;
646  iterator end_;
647 };
648 
649 }
650 
651 #endif
cnoid::Deque2D::cbegin
const_iterator cbegin() const
Definition: Deque2D.h:142
cnoid::Deque2D::Row::at
Element & at(int index)
Definition: Deque2D.h:188
cnoid::Deque2D::Column::iterator::operator!=
bool operator!=(iterator rhs) const
Definition: Deque2D.h:274
cnoid::Deque2D::resizeRow
void resizeRow(int newRowSize)
Definition: Deque2D.h:540
cnoid::Deque2D::end
iterator end()
Definition: Deque2D.h:146
cnoid::Deque2D::column
Column column(int colIndex)
Definition: Deque2D.h:592
cnoid::Deque2D::append
Row append()
Definition: Deque2D.h:600
cnoid::Deque2D::Column::empty
bool empty() const
Definition: Deque2D.h:218
cnoid::Deque2D::Row::Row
Row()
Definition: Deque2D.h:160
cnoid::Deque2D::const_iterator::const_iterator
const_iterator(const const_iterator &org)
Definition: Deque2D.h:41
cnoid::Deque2D::const_iterator::operator<
bool operator<(const const_iterator &rhs) const
Definition: Deque2D.h:94
cnoid::Deque2D::iterator
Definition: Deque2D.h:99
cnoid::Deque2D::operator=
Deque2DType & operator=(const Deque2DType &rhs)
Definition: Deque2D.h:342
cnoid::Deque2D::empty
bool empty() const
Definition: Deque2D.h:379
cnoid::Deque2D::const_iterator
Definition: Deque2D.h:23
cnoid::Deque2D::Row::end
Element * end()
Definition: Deque2D.h:196
cnoid::Deque2D::Row::begin
Element * begin()
Definition: Deque2D.h:192
cnoid::Deque2D::Row::operator[]
const Element & operator[](int index) const
Definition: Deque2D.h:184
cnoid::Deque2D::const_iterator::term
ElementType * term
Definition: Deque2D.h:29
cnoid::Deque2D::Column::begin
iterator begin()
Definition: Deque2D.h:279
cnoid::Deque2D::Row::empty
bool empty() const
Definition: Deque2D.h:172
cnoid::Deque2D::operator()
Element & operator()(int rowIndex, int colIndex)
Definition: Deque2D.h:556
cnoid::Deque2D::Deque2D
Deque2D(const Deque2D< ElementType, Allocator > &org)
Definition: Deque2D.h:316
cnoid::Deque2D::Column::iterator::iterator
iterator(Column &column, Element *pos)
Definition: Deque2D.h:249
cnoid::Deque2D::Deque2D
Deque2D(int rowSize, int colSize)
Definition: Deque2D.h:304
cnoid::Deque2D::Column::operator[]
const Element & operator[](int rowIndex) const
Definition: Deque2D.h:230
cnoid::Deque2D::pop_back
void pop_back()
Definition: Deque2D.h:605
cnoid::Deque2D::last
Row last()
Definition: Deque2D.h:584
cnoid::Deque2D::iterator::operator+
iterator operator+(size_t n)
Definition: Deque2D.h:126
cnoid::Deque2D::Column::Column
Column(const Deque2D< ElementType, Allocator > &owner, int column)
Definition: Deque2D.h:209
cnoid::Deque2D::Column::iterator::operator--
void operator--()
Definition: Deque2D.h:264
cnoid::Deque2D::pop_front
void pop_front(int numRows=1)
Definition: Deque2D.h:609
cnoid::Deque2D::at
const Element & at(int rowIndex, int colIndex) const
Definition: Deque2D.h:560
cnoid::Deque2D::Column::at
Element & at(int index)
Definition: Deque2D.h:234
cnoid::Deque2D::Column::end
iterator end()
Definition: Deque2D.h:282
cnoid::Deque2D::resize
void resize(int newRowSize, int newColSize)
Definition: Deque2D.h:525
cnoid::Deque2D::operator[]
Row operator[](int rowIndex)
Definition: Deque2D.h:568
cnoid::ref_ptr
Definition: Referenced.h:103
cnoid::Deque2D::Column::iterator::operator*
Element & operator*()
Definition: Deque2D.h:255
cnoid::Deque2D::Column::iterator::operator++
void operator++()
Definition: Deque2D.h:258
cnoid::Deque2D::clear
void clear()
Definition: Deque2D.h:548
cnoid::Deque2D::const_iterator::operator*
const Element & operator*() const
Definition: Deque2D.h:47
cnoid::Deque2D::Column::Column
Column()
Definition: Deque2D.h:204
cnoid::Deque2D::column
const Column column(int colIndex) const
Definition: Deque2D.h:596
cnoid::Deque2D::~Deque2D
virtual ~Deque2D()
Definition: Deque2D.h:357
cnoid::Deque2D::Column
Definition: Deque2D.h:201
cnoid::Deque2D::operator[]
const Row operator[](int rowIndex) const
Definition: Deque2D.h:572
cnoid::Deque2D::resizeColumn
void resizeColumn(int newColSize)
Definition: Deque2D.h:529
cnoid::Deque2D::Column::iterator::operator==
bool operator==(iterator rhs) const
Definition: Deque2D.h:271
cnoid::Deque2D::value_type
ElementType value_type
Definition: Deque2D.h:20
cnoid::Deque2D::operator()
const Element & operator()(int rowIndex, int colIndex) const
Definition: Deque2D.h:552
cnoid::Deque2D::iterator::operator*
Element & operator*()
Definition: Deque2D.h:109
cnoid::Deque2D::const_iterator::const_iterator
const_iterator(const Deque2DType &owner, ElementType *pos)
Definition: Deque2D.h:32
cnoid
Definition: AbstractSceneLoader.h:11
cnoid::Deque2D::const_iterator::operator-=
const_iterator & operator-=(size_t n)
Definition: Deque2D.h:71
cnoid::Deque2D::Row::operator[]
Element & operator[](int index)
Definition: Deque2D.h:180
cnoid::Deque2D::const_iterator::const_iterator
const_iterator()
Definition: Deque2D.h:39
cnoid::Deque2D::last
const Row last() const
Definition: Deque2D.h:588
cnoid::Deque2D::const_iterator::buf
ElementType * buf
Definition: Deque2D.h:30
cnoid::Deque2D::row
Row row(int rowIndex)
Definition: Deque2D.h:576
cnoid::Deque2D::iterator::operator-=
iterator & operator-=(size_t n)
Definition: Deque2D.h:119
cnoid::Deque2D::Row::Row
Row(const Deque2D< ElementType, Allocator > &owner, int rowIndex)
Definition: Deque2D.h:164
cnoid::Deque2D::row
const Row row(int rowIndex) const
Definition: Deque2D.h:580
cnoid::Deque2D
Definition: Deque2D.h:15
cnoid::Deque2D::iterator::iterator
iterator()
Definition: Deque2D.h:106
cnoid::Deque2D::Deque2D
Deque2D()
Definition: Deque2D.h:295
cnoid::Deque2D::const_iterator::operator+=
const_iterator & operator+=(size_t n)
Definition: Deque2D.h:64
cnoid::Deque2D::Row::size
int size() const
Definition: Deque2D.h:176
cnoid::Deque2D::iterator::operator-
iterator operator-(size_t n)
Definition: Deque2D.h:131
cnoid::Deque2D::at
Element & at(int rowIndex, int colIndex)
Definition: Deque2D.h:564
cnoid::Deque2D::begin
iterator begin()
Definition: Deque2D.h:138
cnoid::Deque2D::const_iterator::operator-
const_iterator operator-(size_t n)
Definition: Deque2D.h:83
cnoid::Deque2D::const_iterator::operator==
bool operator==(const const_iterator &rhs) const
Definition: Deque2D.h:88
cnoid::Deque2D::colSize
int colSize() const
Definition: Deque2D.h:544
cnoid::Deque2D::const_iterator::current
ElementType * current
Definition: Deque2D.h:28
cnoid::Deque2D::cend
const_iterator cend() const
Definition: Deque2D.h:150
cnoid::Deque2D::iterator::operator+=
iterator & operator+=(size_t n)
Definition: Deque2D.h:112
cnoid::Deque2D::Column::iterator
Definition: Deque2D.h:238
cnoid::Deque2D::Column::operator[]
Element & operator[](int rowIndex)
Definition: Deque2D.h:226
cnoid::Deque2D::const_iterator::operator++
const_iterator & operator++()
Definition: Deque2D.h:50
cnoid::Deque2D::Column::iterator::iterator
iterator()
Definition: Deque2D.h:247
cnoid::Deque2D::Row
Definition: Deque2D.h:154
cnoid::Deque2D::Column::size
int size() const
Definition: Deque2D.h:222
cnoid::Deque2D::const_iterator::operator--
const_iterator & operator--()
Definition: Deque2D.h:57
cnoid::Deque2D::Element
ElementType Element
Definition: Deque2D.h:21
cnoid::Deque2D::rowSize
int rowSize() const
Definition: Deque2D.h:533
cnoid::Deque2D::iterator::iterator
iterator(const iterator &org)
Definition: Deque2D.h:107
cnoid::Deque2D::const_iterator::operator!=
bool operator!=(const const_iterator &rhs) const
Definition: Deque2D.h:91
cnoid::Deque2D::const_iterator::operator+
const_iterator operator+(size_t n)
Definition: Deque2D.h:78