Skip to content

Commit c0ea4f4

Browse files
committed
Made fifo_map_compare::timestamp private
1 parent 612d6da commit c0ea4f4

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

src/fifo_map.hpp

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,15 @@ class fifo_map_compare
9292
m_keys->erase(key);
9393
}
9494

95-
std::size_t timestamp() const
96-
{
97-
return m_timestamp;
98-
}
95+
private:
96+
/// helper to access m_timestamp from fifo_map copy ctor,
97+
/// must have same number of template args as fifo_map
98+
template <
99+
class MapKey,
100+
class MapT,
101+
class MapCompare,
102+
class MapAllocator
103+
> friend class fifo_map;
99104

100105
private:
101106
/// the next valid insertion timestamp
@@ -138,7 +143,7 @@ template <
138143
fifo_map() : m_keys(), m_compare(&m_keys), m_map(m_compare) {}
139144

140145
/// copy constructor
141-
fifo_map(const fifo_map &f) : m_keys(f.m_keys), m_compare(&m_keys, f.m_compare.timestamp()), m_map(f.m_map.begin(), f.m_map.end(), m_compare) {}
146+
fifo_map(const fifo_map &f) : m_keys(f.m_keys), m_compare(&m_keys, f.m_compare.m_timestamp), m_map(f.m_map.begin(), f.m_map.end(), m_compare) {}
142147

143148
/// constructor for a range of elements
144149
template<class InputIterator>

0 commit comments

Comments
 (0)