mirror of
https://github.com/tfussell/xlnt.git
synced 2024-03-22 13:11:17 +08:00
cell_iterator - operator* const overloads
Users may still want to derederence a const iterator (note: not a const_iterator). Also use the "reference" typedef to ensure there is only 1 source of information
This commit is contained in:
parent
92ac3a2a2e
commit
20e72d69e5
|
@ -89,7 +89,13 @@ public:
|
|||
/// <summary>
|
||||
/// Dereferences this iterator to return the cell it points to.
|
||||
/// </summary>
|
||||
cell operator*();
|
||||
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.
|
||||
|
@ -207,6 +213,12 @@ public:
|
|||
/// destructor for const_cell_iterator
|
||||
/// </summary>
|
||||
~const_cell_iterator() = default;
|
||||
|
||||
/// <summary>
|
||||
/// Dereferences this iterator to return the cell it points to.
|
||||
/// </summary>
|
||||
const reference operator*() const;
|
||||
|
||||
/// <summary>
|
||||
/// Dereferences this iterator to return the cell it points to.
|
||||
/// </summary>
|
||||
|
|
|
@ -265,14 +265,18 @@ const_cell_iterator const_cell_iterator::operator++(int)
|
|||
return old;
|
||||
}
|
||||
|
||||
cell cell_iterator::operator*()
|
||||
cell_iterator::reference cell_iterator::operator*()
|
||||
{
|
||||
return ws_.cell(cursor_);
|
||||
}
|
||||
|
||||
const cell const_cell_iterator::operator*() const
|
||||
const cell_iterator::reference cell_iterator::operator*() const
|
||||
{
|
||||
return ws_.cell(cursor_);
|
||||
}
|
||||
|
||||
const const_cell_iterator::reference const_cell_iterator::operator*() const
|
||||
{
|
||||
return ws_.cell(cursor_);
|
||||
}
|
||||
} // namespace xlnt
|
||||
|
|
Loading…
Reference in New Issue
Block a user