| 5694 | |
| 5695 | template <typename T> |
| 5696 | TOML_NODISCARD |
| 5697 | auto* make_node_impl(T && val, value_flags flags = preserve_source_value_flags) |
| 5698 | { |
| 5699 | using unwrapped_type = unwrap_node<remove_cvref<T>>; |
| 5700 | if constexpr (std::is_same_v<unwrapped_type, node> || is_node_view<unwrapped_type>) |
| 5701 | { |
| 5702 | if constexpr (is_node_view<unwrapped_type>) |
| 5703 | { |
| 5704 | if (!val) |
| 5705 | return static_cast<toml::node*>(nullptr); |
| 5706 | } |
| 5707 | |
| 5708 | return static_cast<T&&>(val).visit( |
| 5709 | [flags](auto&& concrete) { |
| 5710 | return static_cast<toml::node*>( |
| 5711 | make_node_impl_specialized(static_cast<decltype(concrete)&&>(concrete), flags)); |
| 5712 | }); |
| 5713 | } |
| 5714 | else |
| 5715 | return make_node_impl_specialized(static_cast<T&&>(val), flags); |
| 5716 | } |
| 5717 | |
| 5718 | template <typename T> |
| 5719 | TOML_NODISCARD |
no outgoing calls
no test coverage detected