| 12169 | |
| 12170 | |
| 12171 | FK_YAML_DETAIL_NAMESPACE_BEGIN |
| 12172 | |
| 12173 | /////////////////////////////////// |
| 12174 | // external_node_constructor // |
| 12175 | /////////////////////////////////// |
| 12176 | |
| 12177 | /// @brief The external constructor template for basic_node objects. |
| 12178 | /// @note All the non-specialized instantiations results in compilation error since such instantiations are not |
| 12179 | /// supported. |
| 12180 | /// @warning All the specialization must call n.m_value.destroy() first in the construct function to avoid |
| 12181 | /// memory leak. |
| 12182 | /// @tparam node_type The resulting YAML node value type. |
| 12183 | template <typename BasicNodeType> |
| 12184 | struct external_node_constructor { |
| 12185 | template <typename... Args> |
| 12186 | static void sequence(BasicNodeType& n, Args&&... args) { |
| 12187 | destroy(n); |
| 12188 | n.m_attrs |= node_attr_bits::seq_bit; |
| 12189 | n.m_value.p_seq = create_object<typename BasicNodeType::sequence_type>(std::forward<Args>(args)...); |
| 12190 | } |
| 12191 | |
| 12192 | template <typename... Args> |
| 12193 | static void mapping(BasicNodeType& n, Args&&... args) { |
no test coverage detected