diff --git a/include/xlnt/worksheet/range_iterator.hpp b/include/xlnt/worksheet/range_iterator.hpp
index 5e942f73..c6f43979 100644
--- a/include/xlnt/worksheet/range_iterator.hpp
+++ b/include/xlnt/worksheet/range_iterator.hpp
@@ -86,7 +86,12 @@ public:
///
/// Dereference the iterator to return a column or row.
///
- cell_vector operator*() const;
+ reference operator*();
+
+ ///
+ /// Dereference the iterator to return a column or row.
+ ///
+ const reference operator*() const;
///
/// Returns true if this iterator is equivalent to other.
@@ -196,7 +201,7 @@ public:
///
/// Dereferennce the iterator to return the current column/row.
///
- const cell_vector operator*() const;
+ const reference operator*() const;
///
/// Returns true if this iterator is equivalent to other.
diff --git a/source/worksheet/range_iterator.cpp b/source/worksheet/range_iterator.cpp
index 57208d26..2c7a3a10 100644
--- a/source/worksheet/range_iterator.cpp
+++ b/source/worksheet/range_iterator.cpp
@@ -28,7 +28,12 @@
namespace xlnt {
-cell_vector range_iterator::operator*() const
+range_iterator::reference range_iterator::operator*()
+{
+ return cell_vector(ws_, cursor_, bounds_, order_, skip_null_, false);
+}
+
+const range_iterator::reference range_iterator::operator*() const
{
return cell_vector(ws_, cursor_, bounds_, order_, skip_null_, false);
}
@@ -264,7 +269,7 @@ const_range_iterator const_range_iterator::operator++(int)
return old;
}
-const cell_vector const_range_iterator::operator*() const
+const const_range_iterator::reference const_range_iterator::operator*() const
{
return cell_vector(ws_, cursor_, bounds_, order_, skip_null_, false);
}