mirror of
https://github.com/ceph/ceph
synced 2025-02-23 02:57:21 +00:00
include/interval_set: do not inherit from std::iterator
std::iterator is deprecated in C++17, so drop it. Signed-off-by: Kefu Chai <kchai@redhat.com>
This commit is contained in:
parent
63b40dbc5b
commit
af3be4b725
@ -113,9 +113,15 @@ class interval_set {
|
||||
friend class interval_set;
|
||||
};
|
||||
|
||||
class const_iterator : public std::iterator <std::forward_iterator_tag, T>
|
||||
class const_iterator
|
||||
{
|
||||
public:
|
||||
using difference_type = ssize_t;
|
||||
using value_type = const typename Map::value_type;
|
||||
using pointer = const typename Map::value_type*;
|
||||
using reference = const typename Map::value_type&;
|
||||
using iterator_category = std::forward_iterator_tag;
|
||||
|
||||
explicit const_iterator(typename Map::const_iterator iter)
|
||||
: _iter(iter)
|
||||
{ }
|
||||
@ -136,7 +142,7 @@ class interval_set {
|
||||
}
|
||||
|
||||
// Dereference this iterator to get a pair.
|
||||
const_reference operator*() const {
|
||||
reference operator*() const {
|
||||
return *_iter;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user