New iterators work\!

This commit is contained in:
beder
2011-09-10 14:16:50 -05:00
parent 89f87d855d
commit c12a03473e
2 changed files with 5 additions and 5 deletions

View File

@@ -10,7 +10,7 @@
#include "yaml-cpp/value/ptr.h" #include "yaml-cpp/value/ptr.h"
#include "yaml-cpp/value/detail/node_iterator.h" #include "yaml-cpp/value/detail/node_iterator.h"
#include <boost/iterator/iterator_adaptor.hpp> #include <boost/iterator/iterator_adaptor.hpp>
#include <boost/utility/enable_if.hpp> #include <boost/utility.hpp>
namespace YAML namespace YAML
{ {
@@ -41,10 +41,10 @@ namespace YAML
private: private:
friend class boost::iterator_core_access; friend class boost::iterator_core_access;
void increment() { this->base_reference() = this->base()->next(); } void increment() { this->base_reference() = boost::next(this->base()); }
void decrement() { this->base_reference() = this->base()->previous(); } 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(); const typename base_type::value_type& v = *this->base();
if(v.pNode) if(v.pNode)
return value_type(Value(*v.pNode, m_pMemory)); return value_type(Value(*v.pNode, m_pMemory));

View File

@@ -109,7 +109,7 @@ namespace YAML
case iterator_type::Sequence: return value_type(**m_seqIt); case iterator_type::Sequence: return value_type(**m_seqIt);
case iterator_type::Map: return value_type(*m_mapIt->first, *m_mapIt->second); case iterator_type::Map: return value_type(*m_mapIt->first, *m_mapIt->second);
} }
return V(); return value_type();
} }
private: private: