From 4246261962f5b3f37cf4e845ff192da2be023834 Mon Sep 17 00:00:00 2001 From: Marc Glisse Date: Fri, 4 Nov 2022 23:39:46 +0100 Subject: Remove the deprecated std::iterator --- .../include/gudhi/Bitmap_cubical_complex.h | 16 ++++++++++++++-- .../include/gudhi/Bitmap_cubical_complex_base.h | 16 ++++++++++++++-- 2 files changed, 28 insertions(+), 4 deletions(-) (limited to 'src/Bitmap_cubical_complex/include/gudhi') diff --git a/src/Bitmap_cubical_complex/include/gudhi/Bitmap_cubical_complex.h b/src/Bitmap_cubical_complex/include/gudhi/Bitmap_cubical_complex.h index 4a6af3a4..ae7e6ed3 100644 --- a/src/Bitmap_cubical_complex/include/gudhi/Bitmap_cubical_complex.h +++ b/src/Bitmap_cubical_complex/include/gudhi/Bitmap_cubical_complex.h @@ -241,10 +241,16 @@ class Bitmap_cubical_complex : public T { **/ class Filtration_simplex_range; - class Filtration_simplex_iterator : std::iterator { + class Filtration_simplex_iterator { // Iterator over all simplices of the complex in the order of the indexing scheme. // 'value_type' must be 'Simplex_handle'. public: + typedef std::input_iterator_tag iterator_category; + typedef Simplex_handle value_type; + typedef std::ptrdiff_t difference_type; + typedef value_type* pointer; + typedef value_type& reference; + Filtration_simplex_iterator(Bitmap_cubical_complex* b) : b(b), position(0) {} Filtration_simplex_iterator() : b(NULL), position(0) {} @@ -386,10 +392,16 @@ class Bitmap_cubical_complex : public T { **/ class Skeleton_simplex_range; - class Skeleton_simplex_iterator : std::iterator { + class Skeleton_simplex_iterator { // Iterator over all simplices of the complex in the order of the indexing scheme. // 'value_type' must be 'Simplex_handle'. public: + typedef std::input_iterator_tag iterator_category; + typedef Simplex_handle value_type; + typedef std::ptrdiff_t difference_type; + typedef value_type* pointer; + typedef value_type& reference; + Skeleton_simplex_iterator(Bitmap_cubical_complex* b, std::size_t d) : b(b), dimension(d) { if (globalDbg) { std::clog << "Skeleton_simplex_iterator ( Bitmap_cubical_complex* b , std::size_t d )\n"; diff --git a/src/Bitmap_cubical_complex/include/gudhi/Bitmap_cubical_complex_base.h b/src/Bitmap_cubical_complex/include/gudhi/Bitmap_cubical_complex_base.h index bafe7981..253e4a54 100644 --- a/src/Bitmap_cubical_complex/include/gudhi/Bitmap_cubical_complex_base.h +++ b/src/Bitmap_cubical_complex/include/gudhi/Bitmap_cubical_complex_base.h @@ -251,8 +251,14 @@ class Bitmap_cubical_complex_base { * @brief Iterator through all cells in the complex (in order they appear in the structure -- i.e. * in lexicographical order). **/ - class All_cells_iterator : std::iterator { + class All_cells_iterator { public: + typedef std::input_iterator_tag iterator_category; + typedef T value_type; + typedef std::ptrdiff_t difference_type; + typedef value_type* pointer; + typedef value_type& reference; + All_cells_iterator() { this->counter = 0; } All_cells_iterator operator++() { @@ -355,8 +361,14 @@ class Bitmap_cubical_complex_base { * @brief Iterator through top dimensional cells of the complex. The cells appear in order they are stored * in the structure (i.e. in lexicographical order) **/ - class Top_dimensional_cells_iterator : std::iterator { + class Top_dimensional_cells_iterator { public: + typedef std::input_iterator_tag iterator_category; + typedef T value_type; + typedef std::ptrdiff_t difference_type; + typedef value_type* pointer; + typedef value_type& reference; + Top_dimensional_cells_iterator(Bitmap_cubical_complex_base& b) : b(b) { this->counter = std::vector(b.dimension()); // std::fill( this->counter.begin() , this->counter.end() , 0 ); -- cgit v1.2.3 From f5af745c4f671f477365115bedf17d167b8d07a5 Mon Sep 17 00:00:00 2001 From: Marc Glisse Date: Fri, 4 Nov 2022 23:46:45 +0100 Subject: Fix bogus traits. Not great, but less broken. --- src/Bitmap_cubical_complex/include/gudhi/Bitmap_cubical_complex.h | 4 ++-- .../include/gudhi/Bitmap_cubical_complex_base.h | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src/Bitmap_cubical_complex/include/gudhi') diff --git a/src/Bitmap_cubical_complex/include/gudhi/Bitmap_cubical_complex.h b/src/Bitmap_cubical_complex/include/gudhi/Bitmap_cubical_complex.h index ae7e6ed3..29fabc6c 100644 --- a/src/Bitmap_cubical_complex/include/gudhi/Bitmap_cubical_complex.h +++ b/src/Bitmap_cubical_complex/include/gudhi/Bitmap_cubical_complex.h @@ -249,7 +249,7 @@ class Bitmap_cubical_complex : public T { typedef Simplex_handle value_type; typedef std::ptrdiff_t difference_type; typedef value_type* pointer; - typedef value_type& reference; + typedef value_type reference; Filtration_simplex_iterator(Bitmap_cubical_complex* b) : b(b), position(0) {} @@ -400,7 +400,7 @@ class Bitmap_cubical_complex : public T { typedef Simplex_handle value_type; typedef std::ptrdiff_t difference_type; typedef value_type* pointer; - typedef value_type& reference; + typedef value_type reference; Skeleton_simplex_iterator(Bitmap_cubical_complex* b, std::size_t d) : b(b), dimension(d) { if (globalDbg) { diff --git a/src/Bitmap_cubical_complex/include/gudhi/Bitmap_cubical_complex_base.h b/src/Bitmap_cubical_complex/include/gudhi/Bitmap_cubical_complex_base.h index 253e4a54..2bf62f9b 100644 --- a/src/Bitmap_cubical_complex/include/gudhi/Bitmap_cubical_complex_base.h +++ b/src/Bitmap_cubical_complex/include/gudhi/Bitmap_cubical_complex_base.h @@ -254,10 +254,10 @@ class Bitmap_cubical_complex_base { class All_cells_iterator { public: typedef std::input_iterator_tag iterator_category; - typedef T value_type; + typedef std::size_t value_type; typedef std::ptrdiff_t difference_type; typedef value_type* pointer; - typedef value_type& reference; + typedef value_type reference; All_cells_iterator() { this->counter = 0; } @@ -364,10 +364,10 @@ class Bitmap_cubical_complex_base { class Top_dimensional_cells_iterator { public: typedef std::input_iterator_tag iterator_category; - typedef T value_type; + typedef std::size_t value_type; typedef std::ptrdiff_t difference_type; typedef value_type* pointer; - typedef value_type& reference; + typedef value_type reference; Top_dimensional_cells_iterator(Bitmap_cubical_complex_base& b) : b(b) { this->counter = std::vector(b.dimension()); -- cgit v1.2.3