Commit c12a0347 authored by beder's avatar beder
Browse files

New iterators work\!

parent 89f87d85
......@@ -10,7 +10,7 @@
#include "yaml-cpp/value/ptr.h"
#include "yaml-cpp/value/detail/node_iterator.h"
#include <boost/iterator/iterator_adaptor.hpp>
#include <boost/utility/enable_if.hpp>
#include <boost/utility.hpp>
namespace YAML
{
......@@ -41,10 +41,10 @@ namespace YAML
private:
friend class boost::iterator_core_access;
void increment() { this->base_reference() = this->base()->next(); }
void decrement() { this->base_reference() = this->base()->previous(); }
void increment() { this->base_reference() = boost::next(this->base()); }
void decrement() { this->base_reference() = boost::prior(this->base()); }
value_type dereference() {
value_type dereference() const {
const typename base_type::value_type& v = *this->base();
if(v.pNode)
return value_type(Value(*v.pNode, m_pMemory));
......
......@@ -109,7 +109,7 @@ namespace YAML
case iterator_type::Sequence: return value_type(**m_seqIt);
case iterator_type::Map: return value_type(*m_mapIt->first, *m_mapIt->second);
}
return V();
return value_type();
}
private:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment