-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathset.hpp
66 lines (54 loc) · 2.43 KB
/
set.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* set.hpp :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: badam <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/07/02 19:49:40 by badam #+# #+# */
/* Updated: 2021/12/18 21:54:33 by badam ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef SET_HPP
# define SET_HPP
# include "utils.hpp"
# include "rbt.hpp"
namespace ft
{
template< class T, class Compare = less<T>, class Alloc = std::allocator<T> >
class set: public rbt<T, T, T, const T, Compare, Alloc>
{
typedef set< T, Compare, Alloc > _self;
typedef rbt< T, T, T, const T, Compare, Alloc > _parent;
public:
typedef typename _parent::key_type key_type;
typedef typename _parent::value_type value_type;
typedef typename _parent::key_compare key_compare;
typedef typename _parent::value_compare value_compare;
typedef typename _parent::allocator_type allocator_type;
typedef typename _parent::reference reference;
typedef typename _parent::const_reference const_reference;
typedef typename _parent::pointer pointer;
typedef typename _parent::const_pointer const_pointer;
typedef typename _parent::iterator iterator;
typedef typename _parent::const_iterator const_iterator;
typedef typename _parent::reverse_iterator reverse_iterator;
typedef typename _parent::const_reverse_iterator const_reverse_iterator;
typedef typename _parent::difference_type difference_type;
typedef typename _parent::size_type size_type;
public:
set(): _parent()
{};
explicit set( const Compare& comp, const Alloc& alloc = Alloc() ): _parent(comp, alloc)
{};
template< class InputIt >
set( InputIt first, InputIt last, const Compare& comp = Compare(), const Alloc& alloc = Alloc() ):
_parent(first, last, comp, alloc)
{};
set( const set& other ): _parent(other)
{}
virtual ~set(void)
{};
};
}
#endif