Changeset 289c954a in mainline
- Timestamp:
- 2018-07-05T21:41:21Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- db05684
- Parents:
- 35b706e8
- git-author:
- Dzejrou <dzejrou@…> (2018-04-11 19:37:57)
- git-committer:
- Dzejrou <dzejrou@…> (2018-07-05 21:41:21)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/cpp/include/impl/deque.hpp
r35b706e8 r289c954a 543 543 size_type max_size() const noexcept 544 544 { 545 // TODO: implement545 return allocator_traits<Allocator>::max_size(allocator_); 546 546 } 547 547 548 548 void resize(size_type sz) 549 549 { 550 // TODO: implement 550 if (sz <= size_) 551 { 552 for (size_type i = 0; i < size_ - sz; ++i) 553 pop_back(); 554 } 555 else 556 { 557 value_type value{}; 558 for (size_type i = 0; i < sz - size_; ++i) 559 push_back(value); 560 } 551 561 } 552 562 553 563 void resize(size_type sz, const value_type& value) 554 564 { 555 // TODO: implement 565 if (sz <= size_) 566 { 567 for (size_type i = 0; i < size_ - sz; ++i) 568 pop_back(); 569 } 570 else 571 { 572 for (size_type i = 0; i < sz - size_; ++i) 573 push_back(value); 574 } 556 575 } 557 576 558 577 void shrink_to_fit() 559 578 { 560 // TODO: implement 579 /** 580 * We lazily allocate buckets and eagerily deallocate them. 581 * We cannot go into smaller pieces as buckets have fixed size. 582 * Because of this, shrink_to_fit has no effect (as permitted 583 * by the standard). 584 */ 561 585 } 562 586
Note:
See TracChangeset
for help on using the changeset viewer.