Commit a1012983 authored by Thomas Corbat's avatar Thomas Corbat
Browse files

Update README.md

Refine assignment for week 5
parent ad6b698f
......@@ -17,7 +17,7 @@ Please form groups of 2-3 students for testat hand-in:
## Iterator for Dynamic Bounded Buffer
Last week you have implemented a dynamic version of the bounded buffer. Finish that exercise first if you have not already completed it.
In this exercise you have to implement `begin` and `end` for your dynamic bounded buffer. This requires your own iterator type, which can cope with the non-consecutive nature of the elements in your heap memory. The implementation of your iterator must be robust against invalid use, i.e. accesses outside the range specified by `begin` (inclusive) and `end` (exclusive) have to throw exceptions. It is not allowed to increment/decrement your iterator beyond these points (`begin`/`end`).
In this exercise you have to implement `begin` and `end` for your dynamic bounded buffer. They will return a random access iterator over the elements in the `BoundedBuffer`. As usual, `begin` shall return an iterator pointing to the first element in the buffer, i.e. the element that would be returned by `front()`. `end()` returns the corrsponding iterator that points behind the last element in the buffer, which is the element returned by `back()`. This requires your own iterator type, which can cope with the non-consecutive nature of the elements in your heap memory. The implementation of your iterator must be robust against invalid use, i.e. accesses outside the range specified by `begin` (inclusive) and `end` (exclusive) have to throw exceptions. It is not allowed to increment/decrement your iterator beyond these points (`begin`/`end`).
Create constant and non-constant iterators. Const iterators provide read-only access to the elements, while the non-const iterators allow changing the elements through the iterator. First, make both versions work! Then you can try to find a smart way to reuse the parts of your implementation and eliminate code duplication.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment