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
098b0d8044
commit
45acf665e3
|
@ -89,7 +89,13 @@ public:
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Dereferences this iterator to return the cell it points to.
|
/// Dereferences this iterator to return the cell it points to.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
cell operator*();
|
reference operator*();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Dereferences this iterator to return the cell it points to.
|
||||||
|
/// </summary>
|
||||||
|
const reference operator*() const;
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns true if this iterator is equivalent to other.
|
/// Returns true if this iterator is equivalent to other.
|
||||||
|
@ -207,6 +213,12 @@ public:
|
||||||
/// destructor for const_cell_iterator
|
/// destructor for const_cell_iterator
|
||||||
/// </summary>
|
/// </summary>
|
||||||
~const_cell_iterator() = default;
|
~const_cell_iterator() = default;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Dereferences this iterator to return the cell it points to.
|
||||||
|
/// </summary>
|
||||||
|
const reference operator*() const;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Dereferences this iterator to return the cell it points to.
|
/// Dereferences this iterator to return the cell it points to.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -265,14 +265,18 @@ const_cell_iterator const_cell_iterator::operator++(int)
|
||||||
return old;
|
return old;
|
||||||
}
|
}
|
||||||
|
|
||||||
cell cell_iterator::operator*()
|
cell_iterator::reference cell_iterator::operator*()
|
||||||
{
|
{
|
||||||
return ws_.cell(cursor_);
|
return ws_.cell(cursor_);
|
||||||
}
|
}
|
||||||
|
|
||||||
const cell const_cell_iterator::operator*() const
|
const cell_iterator::reference cell_iterator::operator*() const
|
||||||
{
|
{
|
||||||
return ws_.cell(cursor_);
|
return ws_.cell(cursor_);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const const_cell_iterator::reference const_cell_iterator::operator*() const
|
||||||
|
{
|
||||||
|
return ws_.cell(cursor_);
|
||||||
|
}
|
||||||
} // namespace xlnt
|
} // namespace xlnt
|
||||||
|
|
Loading…
Reference in New Issue
Block a user