Skip to content

Commit

Permalink
Default-initialize all sub-iterators in node_iterator_base
Browse files Browse the repository at this point in the history
  • Loading branch information
jbeder committed Jan 24, 2015
1 parent 899b661 commit 1006bee
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions include/yaml-cpp/node/detail/node_iterator.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,18 @@ class node_iterator_base
typedef typename node_iterator_type<V>::map MapIter;
typedef node_iterator_value<V> value_type;

node_iterator_base() : m_type(iterator_type::None) {}
node_iterator_base()
: m_type(iterator_type::None), m_seqIt(), m_mapIt(), m_mapEnd() {}
explicit node_iterator_base(SeqIter seqIt)
: m_type(iterator_type::Sequence), m_seqIt(seqIt) {}
: m_type(iterator_type::Sequence),
m_seqIt(seqIt),
m_mapIt(),
m_mapEnd() {}
explicit node_iterator_base(MapIter mapIt, MapIter mapEnd)
: m_type(iterator_type::Map), m_mapIt(mapIt), m_mapEnd(mapEnd) {
: m_type(iterator_type::Map),
m_seqIt(),
m_mapIt(mapIt),
m_mapEnd(mapEnd) {
m_mapIt = increment_until_defined(m_mapIt);
}

Expand Down

0 comments on commit 1006bee

Please sign in to comment.