mirror of
https://github.com/tfussell/xlnt.git
synced 2024-03-22 13:11:17 +08:00
worksheet_iterator - operator* const overloads
Users may still want to dereference 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
91d298abd4
commit
8b885c6a8d
|
@ -88,7 +88,14 @@ public:
|
|||
/// If the iterator points to one-past-the-end of the workbook, an invalid_parameter
|
||||
/// exception will be thrown.
|
||||
/// </summary>
|
||||
worksheet operator*();
|
||||
reference operator*();
|
||||
|
||||
/// <summary>
|
||||
/// Dereferences the iterator to return the worksheet it is pointing to.
|
||||
/// If the iterator points to one-past-the-end of the workbook, an invalid_parameter
|
||||
/// exception will be thrown.
|
||||
/// </summary>
|
||||
const reference operator*() const;
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if this iterator points to the same worksheet as comparand.
|
||||
|
@ -175,7 +182,7 @@ public:
|
|||
/// If the iterator points to one-past-the-end of the workbook, an invalid_parameter
|
||||
/// exception will be thrown.
|
||||
/// </summary>
|
||||
const worksheet operator*();
|
||||
const reference operator*() const;
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if this iterator points to the same worksheet as comparand.
|
||||
|
|
|
@ -32,7 +32,12 @@ worksheet_iterator::worksheet_iterator(workbook &wb, std::size_t index)
|
|||
{
|
||||
}
|
||||
|
||||
worksheet worksheet_iterator::operator*()
|
||||
worksheet_iterator::reference worksheet_iterator::operator*()
|
||||
{
|
||||
return (*wb_)[index_];
|
||||
}
|
||||
|
||||
const worksheet_iterator::reference worksheet_iterator::operator*() const
|
||||
{
|
||||
return (*wb_)[index_];
|
||||
}
|
||||
|
@ -65,7 +70,7 @@ const_worksheet_iterator::const_worksheet_iterator(const workbook &wb, std::size
|
|||
{
|
||||
}
|
||||
|
||||
const worksheet const_worksheet_iterator::operator*()
|
||||
const const_worksheet_iterator::reference const_worksheet_iterator::operator*() const
|
||||
{
|
||||
return wb_->sheet_by_index(index_);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user