diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/iteratorimpl.h | 10 | ||||
-rw-r--r-- | src/valueiterator.cpp | 13 |
2 files changed, 21 insertions, 2 deletions
diff --git a/src/iteratorimpl.h b/src/iteratorimpl.h index 4d15c73..a88282a 100644 --- a/src/iteratorimpl.h +++ b/src/iteratorimpl.h @@ -21,6 +21,16 @@ class IteratorImpl { public: /** + * Constructor + */ + IteratorImpl() {} + + /** + * Destructor + */ + virtual ~IteratorImpl() {} + + /** * Clone the object * @return IteratorImpl* */ diff --git a/src/valueiterator.cpp b/src/valueiterator.cpp index 92a2542..c43fbbb 100644 --- a/src/valueiterator.cpp +++ b/src/valueiterator.cpp @@ -20,6 +20,15 @@ namespace Php { ValueIterator::ValueIterator(const ValueIterator &that) : _impl(that._impl->clone()) {} /** + * Destructor + */ +ValueIterator::~ValueIterator() +{ + // get rid of implementation + delete _impl; +} + +/** * Increment position * @return ValueIterator */ @@ -52,7 +61,7 @@ ValueIterator &ValueIterator::operator--() */ bool ValueIterator::operator==(const ValueIterator &that) const { - return _impl->equals(that._impl.get()); + return _impl->equals(that._impl); } /** @@ -62,7 +71,7 @@ bool ValueIterator::operator==(const ValueIterator &that) const */ bool ValueIterator::operator!=(const ValueIterator &that) const { - return !_impl->equals(that._impl.get()); + return !_impl->equals(that._impl); } /** |