fix deprecation of std::iterator (#7332)
authorOuyancheng <1024842937@qq.com>
Tue, 12 Oct 2021 09:44:50 +0000 (02:44 -0700)
committerGitHub <noreply@github.com>
Tue, 12 Oct 2021 09:44:50 +0000 (09:44 +0000)
commit069fde2aac69f741bc7679f64bbdc9aed4874b73
tree51bfe4c10d06ecdb02b740329ae443539967cdf7
parent2a711652b9715ec931bab431dc0f4b66f1bf70da
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
src/api/cpp/cvc5.h
src/context/cdhashmap.h
src/context/cdlist.h
src/expr/node_self_iterator.h
src/theory/arith/normal_form.h
src/util/bin_heap.h