Skip to content

Commit 5ae0e16

Browse files
author
=
committed
Merge branch 'dev'
2 parents 99f0e00 + 774cb0d commit 5ae0e16

File tree

1 file changed

+76
-49
lines changed

1 file changed

+76
-49
lines changed

Deque.h

+76-49
Original file line numberDiff line numberDiff line change
@@ -187,15 +187,20 @@ class my_deque {
187187
// operator ==
188188
// -----------
189189

190-
/**
190+
/*
191+
* @param lhs iterator
192+
* @param rhs iterator
193+
* @ret true iff the params are equal
191194
*/
192195
friend bool operator == (const iterator& lhs, const iterator& rhs) {
193196
if (&lhs._outter != &rhs._outter)
194197
return false;
195198
return (lhs._index == rhs._index);}
196199

197-
/**
198-
* <your documentation>
200+
/*
201+
* @param lhs iterator
202+
* @param rhs iterator
203+
* @ret true iff the params are not equal
199204
*/
200205
friend bool operator != (const iterator& lhs, const iterator& rhs) {
201206
return !(lhs == rhs);}
@@ -204,8 +209,10 @@ class my_deque {
204209
// operator +
205210
// ----------
206211

207-
/**
208-
* <your documentation>
212+
/*
213+
* @param lhs iterator
214+
* @param diff_type number to add
215+
* @ret the pointer sum of lhs and rhs
209216
*/
210217
friend iterator operator + (iterator lhs, difference_type rhs) {
211218
return lhs += rhs;}
@@ -214,8 +221,10 @@ class my_deque {
214221
// operator -
215222
// ----------
216223

217-
/**
218-
* <your documentation>
224+
/*
225+
* @param lhs iterator
226+
* @param diff_type number to subtract
227+
* @ret the pointer difference of lhs and rhs
219228
*/
220229
friend iterator operator - (iterator lhs, difference_type rhs) {
221230
return lhs -= rhs;}
@@ -242,8 +251,10 @@ class my_deque {
242251
// constructor
243252
// -----------
244253

245-
/**
246-
* <your documentation>
254+
/*
255+
* @param diff_type index
256+
* @param outter the deque to interate over
257+
* @ret new iterator at index
247258
*/
248259
iterator (difference_type index, my_deque& outter): _index(index), _outter(outter) {
249260
assert(valid());}
@@ -257,8 +268,8 @@ class my_deque {
257268
// operator *
258269
// ----------
259270

260-
/**
261-
* <your documentation>
271+
/*
272+
* @ret the value at index
262273
*/
263274
reference operator * () const {
264275
reference dummy = _outter[_index];
@@ -268,8 +279,8 @@ class my_deque {
268279
// operator ->
269280
// -----------
270281

271-
/**
272-
* <your documentation>
282+
/*
283+
* @ret the addess of the container
273284
*/
274285
pointer operator -> () const {
275286
return &**this;}
@@ -278,16 +289,17 @@ class my_deque {
278289
// operator ++
279290
// -----------
280291

281-
/**
282-
* <your documentation>
292+
/*
293+
* @ret the iterator moved forward one spot
283294
*/
284295
iterator& operator ++ () {
285296
++_index;
286297
assert(valid());
287298
return *this;}
288299

289-
/**
290-
* <your documentation>
300+
/*
301+
* moves the iterator forward
302+
* @ret a copy of the original iterator
291303
*/
292304
iterator operator ++ (int) {
293305
iterator x = *this;
@@ -299,16 +311,17 @@ class my_deque {
299311
// operator --
300312
// -----------
301313

302-
/**
303-
* <your documentation>
314+
/*
315+
* @ret the iterator moved backward one spot
304316
*/
305317
iterator& operator -- () {
306318
--_index;
307319
assert(valid());
308320
return *this;}
309321

310-
/**
311-
* <your documentation>
322+
/*
323+
* moves the iterator backward
324+
* @ret a copy of the original iterator
312325
*/
313326
iterator operator -- (int) {
314327
iterator x = *this;
@@ -320,8 +333,9 @@ class my_deque {
320333
// operator +=
321334
// -----------
322335

323-
/**
324-
* <your documentation>
336+
/*
337+
* @param diff_type d value to add
338+
* @ret the iterator moved forward d times
325339
*/
326340
iterator& operator += (difference_type d) {
327341
_index+=d;
@@ -332,8 +346,9 @@ class my_deque {
332346
// operator -=
333347
// -----------
334348

335-
/**
336-
* <your documentation>
349+
/*
350+
* @param diff_type d value to subtract`
351+
* @ret the iterator moved backward d times
337352
*/
338353
iterator& operator -= (difference_type d) {
339354
_index-=d;
@@ -362,16 +377,20 @@ class my_deque {
362377
// operator ==
363378
// -----------
364379

365-
/**
366-
* <your documentation>
380+
/*
381+
* @param lhs iterator
382+
* @param rhs iterator
383+
* @ret true iff the params are equal
367384
*/
368385
friend bool operator == (const const_iterator& lhs, const const_iterator& rhs) {
369386
if (&lhs._outter != &rhs._outter)
370387
return false;
371388
return lhs._index == rhs._index;}
372389

373-
/**
374-
* <your documentation>
390+
/*
391+
* @param lhs iterator
392+
* @param rhs iterator
393+
* @ret true iff the params are not equal
375394
*/
376395
friend bool operator != (const const_iterator& lhs, const const_iterator& rhs) {
377396
return !(lhs == rhs);}
@@ -380,8 +399,10 @@ class my_deque {
380399
// operator +
381400
// ----------
382401

383-
/**
384-
* <your documentation>
402+
/*
403+
* @param lhs iterator
404+
* @param diff_type number to add
405+
* @ret the pointer sum of lhs and rhs
385406
*/
386407
friend const_iterator operator + (const_iterator lhs, difference_type rhs) {
387408
return lhs += rhs;}
@@ -390,8 +411,10 @@ class my_deque {
390411
// operator -
391412
// ----------
392413

393-
/**
394-
* <your documentation>
414+
/*
415+
* @param lhs iterator
416+
* @param diff_type number to subtract
417+
* @ret the pointer difference of lhs and rhs
395418
*/
396419
friend const_iterator operator - (const_iterator lhs, difference_type rhs) {
397420
return lhs -= rhs;}
@@ -433,8 +456,8 @@ class my_deque {
433456
// operator *
434457
// ----------
435458

436-
/**
437-
* <your documentation>
459+
/*
460+
* @ret the value at index
438461
*/
439462
reference operator * () const {
440463
return _outter[_index];}
@@ -443,8 +466,8 @@ class my_deque {
443466
// operator ->
444467
// -----------
445468

446-
/**
447-
* <your documentation>
469+
/*
470+
* @ret the addess of the container
448471
*/
449472
pointer operator -> () const {
450473
return &**this;}
@@ -453,16 +476,17 @@ class my_deque {
453476
// operator ++
454477
// -----------
455478

456-
/**
457-
* <your documentation>
479+
/*
480+
* @ret the iterator moved forward one spot
458481
*/
459482
const_iterator& operator ++ () {
460483
++_index;
461484
assert(valid());
462485
return *this;}
463486

464-
/**
465-
* <your documentation>
487+
/*
488+
* moves the iterator forward
489+
* @ret a copy of the original iterator
466490
*/
467491
const_iterator operator ++ (int) {
468492
const_iterator x = *this;
@@ -474,16 +498,17 @@ class my_deque {
474498
// operator --
475499
// -----------
476500

477-
/**
478-
* <your documentation>
501+
/*
502+
* @ret the iterator moved backward one spot
479503
*/
480504
const_iterator& operator -- () {
481505
--_index;
482506
assert(valid());
483507
return *this;}
484508

485-
/**
486-
* <your documentation>
509+
/*
510+
* moves the iterator backward
511+
* @ret a copy of the original iterator
487512
*/
488513
const_iterator operator -- (int) {
489514
const_iterator x = *this;
@@ -495,8 +520,9 @@ class my_deque {
495520
// operator +=
496521
// -----------
497522

498-
/**
499-
* <your documentation>
523+
/*
524+
* @param diff_type d value to add
525+
* @ret the iterator moved forward d times
500526
*/
501527
const_iterator& operator += (difference_type i2) {
502528
_index += i2;
@@ -507,8 +533,9 @@ class my_deque {
507533
// operator -=
508534
// -----------
509535

510-
/**
511-
* <your documentation>
536+
/*
537+
* @param diff_type d value to subtract`
538+
* @ret the iterator moved backward d times
512539
*/
513540
const_iterator& operator -= (difference_type i2) {
514541
_index -= i2;

0 commit comments

Comments
 (0)