#ifndef TOML11_TO_TOML #define TOML11_TO_TOML #include "value.hpp" namespace toml { template(), typename std::enable_if<(vT != toml::value_t::Unknown && vT != value_t::Empty), std::nullptr_t>::type = nullptr> inline toml::value to_toml(T&& x) { return toml::value(std::forward(x)); } template(), typename std::enable_if<(vT == toml::value_t::Unknown) && (!toml::detail::is_map::value) && toml::detail::is_container::value, std::nullptr_t>::type = nullptr> toml::value to_toml(T&& x) { toml::Array tmp; tmp.reserve(std::distance(std::begin(x), std::end(x))); for(auto iter = std::begin(x); iter != std::end(x); ++iter) tmp.emplace_back(*iter); return toml::value(std::move(tmp)); } template(), typename std::enable_if<(vT == toml::value_t::Unknown) && toml::detail::is_map::value, std::nullptr_t>::type = nullptr> toml::value to_toml(T&& x) { toml::Table tmp; for(auto iter = std::begin(x); iter != std::end(x); ++iter) tmp.emplace(iter->first, to_toml(iter->second)); return toml::value(std::move(tmp)); } template inline toml::value to_toml(std::initializer_list init) { return toml::value(std::move(init)); } inline toml::value to_toml(std::initializer_list> init) { return toml::value(std::move(init)); } } // toml #endif // TOML11_TO_TOML