| 11558 | /// @param array An array object. |
| 11559 | template <typename BasicNodeType, typename T, std::size_t N> |
| 11560 | inline auto from_node(const BasicNodeType& n, T (&array)[N]) |
| 11561 | -> decltype(n.get_value_inplace(std::declval<T&>()), void()) { |
| 11562 | if FK_YAML_UNLIKELY (!n.is_sequence()) { |
| 11563 | throw type_error("The target node value type is not sequence type.", n.get_type()); |
| 11564 | } |
| 11565 | |
| 11566 | // call get_value_inplace(), not get_value(), since the storage to fill the result into is already created. |
| 11567 | for (std::size_t i = 0; i < N; i++) { |
| 11568 | n.at(i).get_value_inplace(array[i]); |
| 11569 | } |
| 11570 | } |
| 11571 | |
| 11572 | /// @brief from_node function for C-style 2D arrays whose element type must be a basic_node template instance type or a |
| 11573 | /// compatible type. |
no test coverage detected