mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice
synced 2025-12-26 14:41:25 +00:00
Fix C++ compatibility issue
Remove deprecation warnings like
In file included from ../../server/char-device.cpp:28:
../../server/safe-list.hpp:108:43: error: 'template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> struct std::iterator' is deprecated [-Werror=deprecated-declarations]
108 | class safe_list<T>::iterator: public std::iterator<std::forward_iterator_tag, T>
| ^~~~~~~~
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
This commit is contained in:
parent
a32b4b5084
commit
acfa6f6bf8
@ -105,11 +105,17 @@ public:
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
class safe_list<T>::iterator: public std::iterator<std::forward_iterator_tag, T>
|
||||
class safe_list<T>::iterator
|
||||
{
|
||||
typedef typename std::forward_list<T,Mallocator<T>>::iterator wrapped;
|
||||
wrapped curr, next;
|
||||
public:
|
||||
using iterator_category = std::forward_iterator_tag;
|
||||
using value_type = T;
|
||||
using difference_type = ptrdiff_t;
|
||||
using pointer = const value_type*;
|
||||
using reference = const value_type&;
|
||||
|
||||
iterator(wrapped init_curr) :
|
||||
curr(init_curr),
|
||||
next(init_curr != wrapped() ? ++init_curr : wrapped())
|
||||
|
||||
Loading…
Reference in New Issue
Block a user