22 lines
447 B
C++
22 lines
447 B
C++
#pragma once
|
|
|
|
#include "ListExceptions.h"
|
|
#include "listE.h"
|
|
|
|
template <class E> class Set : public List<E> {
|
|
public:
|
|
List<E> &append(const E &_newItem) {
|
|
if (this->contains(_newItem)) {
|
|
throw(DuplicateError());
|
|
}
|
|
List<E>::append(_newItem);
|
|
return *this;
|
|
}
|
|
|
|
List<E> &insert(int index, const E &_newItem) = delete;
|
|
|
|
E pop(int index) = delete;
|
|
|
|
int index(const E &target) = delete;
|
|
};
|