mirror of
https://github.com/allankoechke/soci.git
synced 2026-11-30 10:58:24 +00:00
Restore correct rowset_iterator post-increment operator
This operator needs to be defined to satisfy weakly_incrementable concept required for input iterators, but it can be implemented to do the same thing as pre-increment and, crucially, not return anything, as doing this wouldn't make sense here because we can't preserve a copy of the iterator before the increment. See #1327.
This commit is contained in:
@@ -58,8 +58,7 @@ public:
|
||||
return &(operator*());
|
||||
}
|
||||
|
||||
// Iteration operator: as this is an input operator, it only supports
|
||||
// pre-increment
|
||||
// Iteration operators
|
||||
|
||||
rowset_iterator & operator++()
|
||||
{
|
||||
@@ -75,6 +74,14 @@ public:
|
||||
return (*this);
|
||||
}
|
||||
|
||||
void operator++(int)
|
||||
{
|
||||
// This type is an input iterator and only satisfies "weakly
|
||||
// incrementable" requirement, so we don't have to return the previous
|
||||
// value which wouldn't make sense for it.
|
||||
++(*this);
|
||||
}
|
||||
|
||||
// Comparison operators
|
||||
|
||||
bool operator==(rowset_iterator const & rhs) const
|
||||
|
||||
Reference in New Issue
Block a user