diff options
author | Emiel Bruijntjes <emiel.bruijntjes@copernica.com> | 2014-03-20 16:55:51 +0100 |
---|---|---|
committer | Emiel Bruijntjes <emiel.bruijntjes@copernica.com> | 2014-03-20 16:55:51 +0100 |
commit | 42e2402efb8840ee72d145ac3df8a06ccc8f5c7f (patch) | |
tree | 1ccb3eaea273f77931fa671549c092ef47a1e569 /src | |
parent | 4bd9e7af0ab86adc09d449603158c8bc43d7103c (diff) |
removed unique_ptr because client applications do not allow unique_ptr with unknown types
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); } /** |