#ifndef TOML11_TO_TOML #define TOML11_TO_TOML #include "value.hpp" namespace toml { template::value, std::nullptr_t>::type = nullptr> inline value to_toml(const T& x) { return value(x); } template>, std::is_integral >::value, std::nullptr_t>::type = nullptr> inline value to_toml(const T& x) { return value(::toml::Integer(x)); } template>, std::is_floating_point >::value, std::nullptr_t>::type = nullptr> inline value to_toml(const T& x) { return value(::toml::Float(x)); } inline value to_toml(const char* str) { return value(::toml::String(str)); } template>, detail::is_container >::value, std::nullptr_t>::type = nullptr> value to_toml(const T& x) { 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 value(std::move(tmp)); } template>, detail::is_map >::value, std::nullptr_t>::type = nullptr> value to_toml(const T& x) { Table tmp; for(auto iter = std::begin(x); iter != std::end(x); ++iter) { tmp.emplace(iter->first, to_toml(iter->second)); } return value(std::move(tmp)); } template inline value to_toml(std::initializer_list init) { return value(std::move(init)); } inline value to_toml(std::initializer_list> init) { return value(std::move(init)); } template inline value to_toml(const value& x) { return x; } } // toml #endif // TOML11_TO_TOML