mirror of
https://github.com/xfarrow/lasd.git
synced 2025-06-05 21:49:14 +02:00
Library 3
container & iterator.hpp
This commit is contained in:
@ -13,78 +13,70 @@ class Iterator {
|
||||
|
||||
private:
|
||||
|
||||
// ...
|
||||
|
||||
protected:
|
||||
|
||||
// ...
|
||||
|
||||
public:
|
||||
|
||||
// Destructor
|
||||
// ~Iterator() specifiers
|
||||
virtual ~Iterator() = default;
|
||||
|
||||
/* ************************************************************************ */
|
||||
|
||||
// Copy assignment
|
||||
// type operator=(argument); // Copy assignment of abstract types should not be possible.
|
||||
Iterator& operator=(const Iterator&) = delete; // Copy assignment of abstract types should not be possible.
|
||||
|
||||
// Move assignment
|
||||
// type operator=(argument); // Move assignment of abstract types should not be possible.
|
||||
Iterator& operator=(Iterator&&) noexcept = delete; // Move assignment of abstract types should not be possible.
|
||||
|
||||
/* ************************************************************************ */
|
||||
|
||||
// Comparison operators
|
||||
// type operator==(argument) specifiers; // Comparison of abstract types might not be possible.
|
||||
// type operator!=(argument) specifiers; // Comparison of abstract types might not be possible.
|
||||
bool operator==(const Iterator&) const noexcept = delete; // Comparison of abstract types might not be possible.
|
||||
bool operator!=(const Iterator&) const noexcept = delete; // Comparison of abstract types might not be possible.
|
||||
|
||||
/* ************************************************************************ */
|
||||
|
||||
// Specific member functions
|
||||
|
||||
// type operator*() specifiers; // (concrete function must throw std::out_of_range when terminated)
|
||||
virtual Data& operator*() = 0; // (concrete function must throw std::out_of_range when terminated)
|
||||
|
||||
// type Terminated() specifiers; // (concrete function should not throw exceptions)
|
||||
virtual bool Terminated() noexcept = 0; // (concrete function should not throw exceptions)
|
||||
|
||||
};
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
template <typename Data>
|
||||
class ForwardIterator { // Must extend Iterator
|
||||
class ForwardIterator : virtual public Iterator<Data> { // Must extend Iterator
|
||||
|
||||
private:
|
||||
|
||||
// ...
|
||||
|
||||
protected:
|
||||
|
||||
// ...
|
||||
|
||||
public:
|
||||
|
||||
// Destructor
|
||||
// ~ForwardIterator() specifiers
|
||||
virtual ~ForwardIterator() = default;
|
||||
|
||||
/* ************************************************************************ */
|
||||
|
||||
// Copy assignment
|
||||
// type operator=(argument); // Copy assignment of abstract types should not be possible.
|
||||
ForwardIterator& operator=(const ForwardIterator&) = delete; // Copy assignment of abstract types should not be possible.
|
||||
|
||||
// Move assignment
|
||||
// type operator=(argument); // Move assignment of abstract types should not be possible.
|
||||
ForwardIterator& operator=(ForwardIterator&&) noexcept = delete; // Move assignment of abstract types should not be possible.
|
||||
|
||||
/* ************************************************************************ */
|
||||
|
||||
// Comparison operators
|
||||
// type operator==(argument) specifiers; // Comparison of abstract types might not be possible.
|
||||
// type operator!=(argument) specifiers; // Comparison of abstract types might not be possible.
|
||||
bool operator==(const ForwardIterator&) const noexcept = delete; // Comparison of abstract types might not be possible.
|
||||
bool operator!=(const ForwardIterator&) const noexcept = delete; // Comparison of abstract types might not be possible.
|
||||
|
||||
/* ************************************************************************ */
|
||||
|
||||
// Specific member functions
|
||||
|
||||
// type operator++() specifiers; // (concrete function must throw std::out_of_range when terminated)
|
||||
virtual ForwardIterator& operator++() = 0; // (concrete function must throw std::out_of_range when terminated)
|
||||
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user