Modernisation: has_next() returns bool instead of long

This commit is contained in:
Eugen Betke 2024-10-17 12:06:14 +02:00
parent b490cfc3d3
commit 2bd5482629
3 changed files with 6 additions and 6 deletions

View File

@ -29,7 +29,7 @@ public:
virtual int previous(double*, double*, double*) = 0;
virtual int reset() = 0;
virtual int destroy() = 0;
virtual long has_next() = 0;
virtual bool has_next() = 0;
virtual Iterator* create() const = 0;
public:

View File

@ -88,13 +88,13 @@ int Gen::destroy()
return Iterator::destroy();
}
long Gen::has_next()
bool Gen::has_next()
{
if (flags_ == 0 && data_ == NULL)
return 0;
return false;
if (e_ >= (long)(nv_ - 1))
return 0;
return 1;
return false;
return true;
}
int Gen::previous(double*, double*, double*) {

View File

@ -27,7 +27,7 @@ public:
int previous(double*, double*, double*) override;
int reset() override;
int destroy() override;
long has_next() override; // TODO(maee/masn): return bool please!
bool has_next() override;
public:
//int get(double*, double*, double*);