C++ Группа 1 — различия между версиями
(→intro to exceptions) |
|||
Строка 10: | Строка 10: | ||
Также реализовать специализацию получившегося шаблона оптимизированную для хранения бит: vector<bool>. | Также реализовать специализацию получившегося шаблона оптимизированную для хранения бит: vector<bool>. | ||
− | == | + | == Intro to exceptions == |
https://www.dropbox.com/s/opxblrdj74gieeg/assignment.cc?dl=0 | https://www.dropbox.com/s/opxblrdj74gieeg/assignment.cc?dl=0 | ||
https://www.dropbox.com/s/8xivap6w7n97qix/new_assignment.cc?dl=0 | https://www.dropbox.com/s/8xivap6w7n97qix/new_assignment.cc?dl=0 | ||
+ | |||
+ | == Exceptions Safety == | ||
+ | |||
+ | ==== Main ==== | ||
+ | |||
+ | Reconsider your own `vector` implementation towards making it ''[http://en.wikipedia.org/wiki/Exception_safety exception-safe]''. | ||
+ | |||
+ | Following members of your `vector` implementation should be reconsidered to match corresponding ''[http://en.wikipedia.org/wiki/Exception_safety exception-safety guarantees]'': | ||
+ | |||
+ | * '''operator=''' (strong) | ||
+ | * '''push_back''' (strong) | ||
+ | |||
+ | ==== Extra ==== | ||
+ | |||
+ | Try match your implementation on the functions predefined inside STL. | ||
+ | |||
+ | Try to reduce boilerplate inside your implementation relying on the standard-library defined utilities. | ||
+ | |||
+ | ''Hint'': see [http://en.cppreference.com/w/cpp/header/memory memory] header closely (`uninitialized_*` family). |
Версия 11:34, 4 марта 2016
Кудинкин Алексей
+7-911-748-38-35
vector<T>/vector<bool>
Реализовать шаблонную версию ранее реализованного контейнера vector. Также реализовать специализацию получившегося шаблона оптимизированную для хранения бит: vector<bool>.
Intro to exceptions
https://www.dropbox.com/s/opxblrdj74gieeg/assignment.cc?dl=0
https://www.dropbox.com/s/8xivap6w7n97qix/new_assignment.cc?dl=0
Exceptions Safety
Main
Reconsider your own `vector` implementation towards making it exception-safe.
Following members of your `vector` implementation should be reconsidered to match corresponding exception-safety guarantees:
- operator= (strong)
- push_back (strong)
Extra
Try match your implementation on the functions predefined inside STL.
Try to reduce boilerplate inside your implementation relying on the standard-library defined utilities.
Hint: see memory header closely (`uninitialized_*` family).