mirror of
https://github.com/jbeder/yaml-cpp.git
synced 2025-09-09 20:51:16 +00:00
New iterators work\!
This commit is contained in:
@@ -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));
|
||||||
|
@@ -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:
|
||||||
|
Reference in New Issue
Block a user