MCPcopy Create free account
hub / github.com/OpenPathGuidingLibrary/openpgl / ContainerInternal

Class ContainerInternal

openpgl/data/SampleContainerInternal.h:15–224  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13
14template <typename Type>
15struct ContainerInternal
16{
17 struct Iterator
18 {
19 using iterator_category = std::forward_iterator_tag;
20 using difference_type = std::ptrdiff_t;
21 using value_type = Type;
22 using pointer = Type *;
23 using reference = Type &;
24
25 Iterator() : m_ptr(nullptr) {}
26 Iterator(pointer ptr) : m_ptr(ptr) {}
27
28 reference operator*() const
29 {
30 return *m_ptr;
31 }
32 pointer operator->()
33 {
34 return m_ptr;
35 }
36
37 // Prefix and postfix increment
38 Iterator &operator++()
39 {
40 m_ptr++;
41 return *this;
42 }
43 Iterator operator++(int)
44 {
45 Iterator tmp = *this;
46 ++(*this);
47 return tmp;
48 }
49
50 // Prefix and postfix decrement
51 Iterator &operator--()
52 {
53 --m_ptr;
54 return *this;
55 }
56 Iterator operator--(int)
57 {
58 Iterator tmp(*this);
59 operator--();
60 return tmp;
61 }
62
63 friend Iterator operator+(const Iterator lhs, const int idx)
64 {
65 return Iterator(lhs.m_ptr + idx);
66 }
67 friend Iterator operator+=(const Iterator lhs, const int idx)
68 {
69 return Iterator(lhs.m_ptr + idx);
70 }
71 friend Iterator operator-(const Iterator lhs, const int idx)
72 {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected