Skip to content

Commit 79a4dc4

Browse files
committed
add using for the allocation in the list container
1 parent 0e59ae9 commit 79a4dc4

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

include/forward_tlist/forward_tlist.h

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
#define FORWARD_LIST_FORWARD_TLIST_H
33

44
#include "forward_tlist_node.h"
5-
#include <cstddef>
65
#include <memory>
76

87
namespace tlib{
@@ -11,11 +10,16 @@ namespace tlib{
1110
using allocator_type = allocator;
1211
using iterator = tlib::forward_tlist_iterator<T>;
1312
using value_type = typename allocator::value_type;
13+
using pointer = typename allocator::pointer;
14+
using reference = typename allocator::reference;
15+
using const_reference = typename allocator::const_reference;
16+
using size_type = typename allocator::size_type;
17+
1418
public:
1519
forward_tlist(): head(nullptr), tail(nullptr), size_(0) {};
1620
~forward_tlist() { delete head; }
1721
bool empty() { return head == nullptr; }
18-
std::size_t size() const;
22+
size_type size() const;
1923
/**
2024
* Prepends the given element to the beginning of the container
2125
* No iterators are invalidated
@@ -26,7 +30,7 @@ namespace tlib{
2630
iterator end() { return forward_tlist_iterator<T>(nullptr); }
2731

2832
private:
29-
std::size_t size_;
33+
size_type size_;
3034
forward_tlist_node<T> *head;
3135
forward_tlist_node<T> *tail;
3236
}; //class forward_tlist

0 commit comments

Comments
 (0)