@@ -187,15 +187,20 @@ class my_deque {
187
187
// operator ==
188
188
// -----------
189
189
190
- /* *
190
+ /*
191
+ * @param lhs iterator
192
+ * @param rhs iterator
193
+ * @ret true iff the params are equal
191
194
*/
192
195
friend bool operator == (const iterator& lhs, const iterator& rhs) {
193
196
if (&lhs._outter != &rhs._outter )
194
197
return false ;
195
198
return (lhs._index == rhs._index );}
196
199
197
- /* *
198
- * <your documentation>
200
+ /*
201
+ * @param lhs iterator
202
+ * @param rhs iterator
203
+ * @ret true iff the params are not equal
199
204
*/
200
205
friend bool operator != (const iterator& lhs, const iterator& rhs) {
201
206
return !(lhs == rhs);}
@@ -204,8 +209,10 @@ class my_deque {
204
209
// operator +
205
210
// ----------
206
211
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
209
216
*/
210
217
friend iterator operator + (iterator lhs, difference_type rhs) {
211
218
return lhs += rhs;}
@@ -214,8 +221,10 @@ class my_deque {
214
221
// operator -
215
222
// ----------
216
223
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
219
228
*/
220
229
friend iterator operator - (iterator lhs, difference_type rhs) {
221
230
return lhs -= rhs;}
@@ -242,8 +251,10 @@ class my_deque {
242
251
// constructor
243
252
// -----------
244
253
245
- /* *
246
- * <your documentation>
254
+ /*
255
+ * @param diff_type index
256
+ * @param outter the deque to interate over
257
+ * @ret new iterator at index
247
258
*/
248
259
iterator (difference_type index, my_deque& outter): _index(index), _outter(outter) {
249
260
assert (valid ());}
@@ -257,8 +268,8 @@ class my_deque {
257
268
// operator *
258
269
// ----------
259
270
260
- /* *
261
- * <your documentation>
271
+ /*
272
+ * @ret the value at index
262
273
*/
263
274
reference operator * () const {
264
275
reference dummy = _outter[_index];
@@ -268,8 +279,8 @@ class my_deque {
268
279
// operator ->
269
280
// -----------
270
281
271
- /* *
272
- * <your documentation>
282
+ /*
283
+ * @ret the addess of the container
273
284
*/
274
285
pointer operator -> () const {
275
286
return &**this ;}
@@ -278,16 +289,17 @@ class my_deque {
278
289
// operator ++
279
290
// -----------
280
291
281
- /* *
282
- * <your documentation>
292
+ /*
293
+ * @ret the iterator moved forward one spot
283
294
*/
284
295
iterator& operator ++ () {
285
296
++_index;
286
297
assert (valid ());
287
298
return *this ;}
288
299
289
- /* *
290
- * <your documentation>
300
+ /*
301
+ * moves the iterator forward
302
+ * @ret a copy of the original iterator
291
303
*/
292
304
iterator operator ++ (int ) {
293
305
iterator x = *this ;
@@ -299,16 +311,17 @@ class my_deque {
299
311
// operator --
300
312
// -----------
301
313
302
- /* *
303
- * <your documentation>
314
+ /*
315
+ * @ret the iterator moved backward one spot
304
316
*/
305
317
iterator& operator -- () {
306
318
--_index;
307
319
assert (valid ());
308
320
return *this ;}
309
321
310
- /* *
311
- * <your documentation>
322
+ /*
323
+ * moves the iterator backward
324
+ * @ret a copy of the original iterator
312
325
*/
313
326
iterator operator -- (int ) {
314
327
iterator x = *this ;
@@ -320,8 +333,9 @@ class my_deque {
320
333
// operator +=
321
334
// -----------
322
335
323
- /* *
324
- * <your documentation>
336
+ /*
337
+ * @param diff_type d value to add
338
+ * @ret the iterator moved forward d times
325
339
*/
326
340
iterator& operator += (difference_type d) {
327
341
_index+=d;
@@ -332,8 +346,9 @@ class my_deque {
332
346
// operator -=
333
347
// -----------
334
348
335
- /* *
336
- * <your documentation>
349
+ /*
350
+ * @param diff_type d value to subtract`
351
+ * @ret the iterator moved backward d times
337
352
*/
338
353
iterator& operator -= (difference_type d) {
339
354
_index-=d;
@@ -362,16 +377,20 @@ class my_deque {
362
377
// operator ==
363
378
// -----------
364
379
365
- /* *
366
- * <your documentation>
380
+ /*
381
+ * @param lhs iterator
382
+ * @param rhs iterator
383
+ * @ret true iff the params are equal
367
384
*/
368
385
friend bool operator == (const const_iterator& lhs, const const_iterator& rhs) {
369
386
if (&lhs._outter != &rhs._outter )
370
387
return false ;
371
388
return lhs._index == rhs._index ;}
372
389
373
- /* *
374
- * <your documentation>
390
+ /*
391
+ * @param lhs iterator
392
+ * @param rhs iterator
393
+ * @ret true iff the params are not equal
375
394
*/
376
395
friend bool operator != (const const_iterator& lhs, const const_iterator& rhs) {
377
396
return !(lhs == rhs);}
@@ -380,8 +399,10 @@ class my_deque {
380
399
// operator +
381
400
// ----------
382
401
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
385
406
*/
386
407
friend const_iterator operator + (const_iterator lhs, difference_type rhs) {
387
408
return lhs += rhs;}
@@ -390,8 +411,10 @@ class my_deque {
390
411
// operator -
391
412
// ----------
392
413
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
395
418
*/
396
419
friend const_iterator operator - (const_iterator lhs, difference_type rhs) {
397
420
return lhs -= rhs;}
@@ -433,8 +456,8 @@ class my_deque {
433
456
// operator *
434
457
// ----------
435
458
436
- /* *
437
- * <your documentation>
459
+ /*
460
+ * @ret the value at index
438
461
*/
439
462
reference operator * () const {
440
463
return _outter[_index];}
@@ -443,8 +466,8 @@ class my_deque {
443
466
// operator ->
444
467
// -----------
445
468
446
- /* *
447
- * <your documentation>
469
+ /*
470
+ * @ret the addess of the container
448
471
*/
449
472
pointer operator -> () const {
450
473
return &**this ;}
@@ -453,16 +476,17 @@ class my_deque {
453
476
// operator ++
454
477
// -----------
455
478
456
- /* *
457
- * <your documentation>
479
+ /*
480
+ * @ret the iterator moved forward one spot
458
481
*/
459
482
const_iterator& operator ++ () {
460
483
++_index;
461
484
assert (valid ());
462
485
return *this ;}
463
486
464
- /* *
465
- * <your documentation>
487
+ /*
488
+ * moves the iterator forward
489
+ * @ret a copy of the original iterator
466
490
*/
467
491
const_iterator operator ++ (int ) {
468
492
const_iterator x = *this ;
@@ -474,16 +498,17 @@ class my_deque {
474
498
// operator --
475
499
// -----------
476
500
477
- /* *
478
- * <your documentation>
501
+ /*
502
+ * @ret the iterator moved backward one spot
479
503
*/
480
504
const_iterator& operator -- () {
481
505
--_index;
482
506
assert (valid ());
483
507
return *this ;}
484
508
485
- /* *
486
- * <your documentation>
509
+ /*
510
+ * moves the iterator backward
511
+ * @ret a copy of the original iterator
487
512
*/
488
513
const_iterator operator -- (int ) {
489
514
const_iterator x = *this ;
@@ -495,8 +520,9 @@ class my_deque {
495
520
// operator +=
496
521
// -----------
497
522
498
- /* *
499
- * <your documentation>
523
+ /*
524
+ * @param diff_type d value to add
525
+ * @ret the iterator moved forward d times
500
526
*/
501
527
const_iterator& operator += (difference_type i2) {
502
528
_index += i2;
@@ -507,8 +533,9 @@ class my_deque {
507
533
// operator -=
508
534
// -----------
509
535
510
- /* *
511
- * <your documentation>
536
+ /*
537
+ * @param diff_type d value to subtract`
538
+ * @ret the iterator moved backward d times
512
539
*/
513
540
const_iterator& operator -= (difference_type i2) {
514
541
_index -= i2;
0 commit comments