ORIGINAL
Loading...
Searching...
No Matches
set.h
Go to the documentation of this file.
1#ifndef SET_H
2#define SET_H
3
4
5#include "allocator.h"
6#include "container.h"
7
8
22
23namespace original {
24
43 template <typename K_TYPE, typename ALLOC = allocator<K_TYPE>>
44 class set : public container<K_TYPE, ALLOC> {
45 protected:
46
54 explicit set(ALLOC alloc = ALLOC{});
55
56 public:
57
64 virtual bool add(const K_TYPE& e) = 0;
65
72 virtual bool remove(const K_TYPE& e) = 0;
73
80 ~set() override;
81 };
82}
83
84template<typename K_TYPE, typename ALLOC>
86 : container<K_TYPE, ALLOC>(std::move(alloc)) {}
87
88template<typename K_TYPE, typename ALLOC>
90
91#endif //SET_H
Memory allocation interface and implementations.
container(ALLOC alloc=ALLOC{})
Constructs a container with specified allocator.
Definition container.h:129
~set() override
Destructor implementation.
virtual bool add(const K_TYPE &e)=0
Adds a new element to the set.
virtual bool remove(const K_TYPE &e)=0
Removes an element from the set.
set(ALLOC alloc=ALLOC{})
Constructor implementation.
Definition set.h:85
Abstract base class for container types.
Main namespace for the project Original.
Definition algorithms.h:21