cell iterator - add operator->

Implementation just forwards to operator*, but this is a typical operator in the iterator API and is suprising and inconvenient that it is not present
This commit is contained in:
Crzyrndm 2018-05-31 13:18:39 +12:00
parent 45acf665e3
commit fcca46012e
2 changed files with 26 additions and 1 deletions

View File

@ -96,6 +96,15 @@ public:
/// </summary>
const reference operator*() const;
/// <summary>
/// Dereferences this iterator to return the cell it points to.
/// </summary>
reference operator->();
/// <summary>
/// Dereferences this iterator to return the cell it points to.
/// </summary>
const reference operator->() const;
/// <summary>
/// Returns true if this iterator is equivalent to other.
@ -222,7 +231,7 @@ public:
/// <summary>
/// Dereferences this iterator to return the cell it points to.
/// </summary>
const cell operator*() const;
const reference operator->() const;
/// <summary>
/// Returns true if this iterator is equivalent to other.

View File

@ -279,4 +279,20 @@ const const_cell_iterator::reference const_cell_iterator::operator*() const
{
return ws_.cell(cursor_);
}
cell_iterator::reference cell_iterator::operator->()
{
return operator*();
}
const cell_iterator::reference cell_iterator::operator->() const
{
return operator*();
}
const const_cell_iterator::reference const_cell_iterator::operator->() const
{
return operator*();
}
} // namespace xlnt