Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(iterator): remove deprecated inheritance from std::iterator (#97) #194

Merged
merged 1 commit into from
May 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 18 additions & 6 deletions include/boost/numeric/ublas/detail/iterator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,12 @@ namespace boost { namespace numeric { namespace ublas {
* via the post increment operator.
*/
template<class IC, class I, class T>
struct forward_iterator_base:
public std::iterator<IC, T> {
struct forward_iterator_base {
typedef IC iterator_category;
typedef T value_type;
typedef std::ptrdiff_t difference_type;
typedef T* pointer;
typedef T& reference;
typedef I derived_iterator_type;
typedef T derived_value_type;

Expand Down Expand Up @@ -145,8 +149,12 @@ namespace boost { namespace numeric { namespace ublas {
* via the post increment and post decrement operator.
*/
template<class IC, class I, class T>
struct bidirectional_iterator_base:
public std::iterator<IC, T> {
struct bidirectional_iterator_base {
typedef IC iterator_category;
typedef T value_type;
typedef std::ptrdiff_t difference_type;
typedef T* pointer;
typedef T& reference;
typedef I derived_iterator_type;
typedef T derived_value_type;

Expand Down Expand Up @@ -200,8 +208,12 @@ namespace boost { namespace numeric { namespace ublas {
*/
template<class IC, class I, class T, class D = std::ptrdiff_t>
// ISSUE the default for D seems rather dangerous as it can easily be (silently) incorrect
struct random_access_iterator_base:
public std::iterator<IC, T> {
struct random_access_iterator_base {
typedef IC iterator_category;
typedef T value_type;
typedef D difference_type;
typedef T* pointer;
typedef T& reference;
typedef I derived_iterator_type;
typedef T derived_value_type;
typedef D derived_difference_type;
Expand Down