mirror of
https://github.com/ToruNiina/toml11.git
synced 2025-12-16 03:08:52 +08:00
Merge pull request #40 from ToruNiina/remove-to-toml
refactor: remove to_toml and related tests
This commit is contained in:
@@ -1,49 +0,0 @@
|
||||
// Copyright Toru Niina 2017.
|
||||
// Distributed under the MIT License.
|
||||
#ifndef TOML11_TO_TOML_HPP
|
||||
#define TOML11_TO_TOML_HPP
|
||||
#include "value.hpp"
|
||||
|
||||
namespace toml
|
||||
{
|
||||
|
||||
template<typename T>
|
||||
TOML11_MARK_AS_DEPRECATED
|
||||
inline value to_toml(T&& x)
|
||||
{
|
||||
return value(std::forward<T>(x));
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
TOML11_MARK_AS_DEPRECATED
|
||||
inline value to_toml(T&& x, string_t kind)
|
||||
{
|
||||
return value(std::forward<T>(x), kind);
|
||||
}
|
||||
|
||||
TOML11_MARK_AS_DEPRECATED
|
||||
inline value to_toml(local_date d, local_time t)
|
||||
{
|
||||
return value(local_datetime(d, t));
|
||||
}
|
||||
TOML11_MARK_AS_DEPRECATED
|
||||
inline value to_toml(local_date d, local_time t, time_offset ofs)
|
||||
{
|
||||
return value(offset_datetime(d, t, ofs));
|
||||
}
|
||||
|
||||
template<typename ... Ts>
|
||||
TOML11_MARK_AS_DEPRECATED
|
||||
inline value to_toml(Ts&& ... xs)
|
||||
{
|
||||
return value(toml::array{toml::value(std::forward<Ts>(xs)) ... });
|
||||
}
|
||||
|
||||
TOML11_MARK_AS_DEPRECATED
|
||||
inline value to_toml(std::initializer_list<std::pair<std::string, toml::value>> xs)
|
||||
{
|
||||
return value(toml::table(xs.begin(), xs.end()));
|
||||
}
|
||||
|
||||
} // toml
|
||||
#endif // TOML11_TO_TOML
|
||||
Reference in New Issue
Block a user