diff options
author | Ouyancheng <1024842937@qq.com> | 2021-10-12 02:44:50 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-12 09:44:50 +0000 |
commit | 069fde2aac69f741bc7679f64bbdc9aed4874b73 (patch) | |
tree | 51bfe4c10d06ecdb02b740329ae443539967cdf7 /src/context/cdlist.h | |
parent | 2a711652b9715ec931bab431dc0f4b66f1bf70da (diff) |
fix deprecation of std::iterator (#7332)
When compiling cvc5 with clang-13, it will emit lots of warnings of usages of `std::iterator` as it's deprecated since C++17.
The recommended implementation of iterators is to manually define the following five types:
```
template< class Iter >
struct iterator_traits;
difference_type Iter::difference_type
value_type Iter::value_type
pointer Iter::pointer
reference Iter::reference
iterator_category Iter::iterator_category
```
And the iterator-related types could be accessed by for example `typename std::iterator_traits<Iter>::value_type value`.
This pull request performs the fix, and the program is semantically equivalent before and after the fix.
References:
https://en.cppreference.com/w/cpp/iterator/iterator_traits
https://en.cppreference.com/w/cpp/iterator/iterator
Diffstat (limited to 'src/context/cdlist.h')
-rw-r--r-- | src/context/cdlist.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/context/cdlist.h b/src/context/cdlist.h index 007acc64d..997dbc924 100644 --- a/src/context/cdlist.h +++ b/src/context/cdlist.h @@ -384,7 +384,7 @@ protected: // FIXME we support operator--, but do we satisfy all the // requirements of a bidirectional iterator ? - typedef std::input_iterator_tag iterator_category; + typedef std::bidirectional_iterator_tag iterator_category; typedef T value_type; typedef std::ptrdiff_t difference_type; typedef const T* pointer; |