B0 — различия между версиями
(→Весенний Семестр) |
|||
Строка 19: | Строка 19: | ||
* ''resize'' | * ''resize'' | ||
* ''back'' | * ''back'' | ||
+ | * ''size'' | ||
* ''begin/rbegin'' | * ''begin/rbegin'' | ||
* ''end/rend'' | * ''end/rend'' | ||
Строка 33: | Строка 34: | ||
That means: no more `_Exit`s, `abort`s, etc. Exceptions '''only'''. | That means: no more `_Exit`s, `abort`s, etc. Exceptions '''only'''. | ||
+ | |||
+ | == #4 Deque == | ||
+ | |||
+ | Implement double-ended queue matching interface of thereof inside STL ([http://en.cppreference.com/w/cpp/container/deque std::deque]) and ''matching'' its performance requirements. | ||
+ | |||
+ | At the very least, it should contain following members: | ||
+ | |||
+ | * ''push_back'' | ||
+ | * ''pop_back'' | ||
+ | * ''push_front'' | ||
+ | * ''pop_front'' | ||
+ | * ''insert'' | ||
+ | * ''clear'' | ||
+ | * ''resize'' | ||
+ | * ''back'' | ||
+ | * ''front'' | ||
+ | * ''size'' | ||
+ | * ''begin/rbegin'' | ||
+ | * ''end/rend'' | ||
+ | |||
+ | '''NB''': Implementing deque matching performance requirements of the STL one, try to minimize ''unused'' memory 'committed' by your implementation. | ||
+ | |||
+ | If you consider that it's impossible, be ready to assure your point. | ||
+ | |||
+ | == #5 Exceptions Guarantees == |
Версия 00:12, 29 марта 2015
Содержание
Осенний Семестр
TBD
Весенний Семестр
#2 Vector
Part One
Implement vector-alike container matching performance requirements of the `std::vector`.
It should contain implementation for the following methods matching behaviour of the ones of `std::vector`:
- push_back
- pop_back
- insert
- clear
- resize
- back
- size
- begin/rbegin
- end/rend
As a reference consider en.cppreference.com.
Part Two
Implement specialization of already implemented (template-) container for the simple type `bool` being as compact as possible.
#3 Throwing Vector
Now you've got an insight what the C++ exceptions are, implement all error handling inside your implementation of the `vector`, relying solely upon the exceptions mechanism.
That means: no more `_Exit`s, `abort`s, etc. Exceptions only.
#4 Deque
Implement double-ended queue matching interface of thereof inside STL (std::deque) and matching its performance requirements.
At the very least, it should contain following members:
- push_back
- pop_back
- push_front
- pop_front
- insert
- clear
- resize
- back
- front
- size
- begin/rbegin
- end/rend
NB: Implementing deque matching performance requirements of the STL one, try to minimize unused memory 'committed' by your implementation.
If you consider that it's impossible, be ready to assure your point.