Function id

Synopsis

#include <src/c4/yml/tree.hpp>

size_t id(NodeData const *n) const

Description

get the index of a node belonging to this tree. n can be nullptr, in which case a

Source

Lines 476-484 in src/c4/yml/tree.hpp.

size_t id(NodeData const* n) const
{
    if( ! n)
    {
        return NONE;
    }
    RYML_ASSERT(n >= m_buf && n < m_buf + m_cap);
    return static_cast<size_t>(n - m_buf);
}





Add Discussion as Guest

Log in