C++ Группа 1

Материал из SEWiki
Версия от 12:51, 25 марта 2016; Alexey.kudinkin (обсуждение | вклад) (Advanced)

(разн.) ← Предыдущая | Текущая версия (разн.) | Следующая → (разн.)
Перейти к: навигация, поиск

Кудинкин Алексей

alexey.kudinkin@gmail.com

+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).

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.


Algorithms quiz

Functors

Basic

Implement `mem_fn` functor class to match the behaviour of `std::mem_fn`

https://www.dropbox.com/s/ur030ymh9ogetm3/assignment.cc?dl=0

Advanced

Implement place-holding logic of the `std::bind`

https://www.dropbox.com/s/pidfxlzc18kvl1y/bind.cc?dl=0