diff --git a/toml/to_toml.hpp b/toml/to_toml.hpp index 348ce47..eb7eff1 100644 --- a/toml/to_toml.hpp +++ b/toml/to_toml.hpp @@ -8,32 +8,38 @@ namespace toml { template +TOML11_MARK_AS_DEPRECATED inline value to_toml(T&& x) { return value(std::forward(x)); } template +TOML11_MARK_AS_DEPRECATED inline value to_toml(T&& x, string_t kind) { return value(std::forward(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 +TOML11_MARK_AS_DEPRECATED inline value to_toml(Ts&& ... xs) { return value(toml::array{toml::value(std::forward(xs)) ... }); } +TOML11_MARK_AS_DEPRECATED inline value to_toml(std::initializer_list> xs) { return value(toml::table(xs.begin(), xs.end())); diff --git a/toml/utility.hpp b/toml/utility.hpp index 6202163..a560f5d 100644 --- a/toml/utility.hpp +++ b/toml/utility.hpp @@ -7,6 +7,16 @@ #include #include +#if __cplusplus >= 201402L +# define TOML11_MARK_AS_DEPRECATED [[deprecated]] +#elif defined(__GNUC__) +# define TOML11_MARK_AS_DEPRECATED __attribute__((deprecated)) +#elif defined(_MSC_VER) +# define TOML11_MARK_AS_DEPRECATED __declspec(deprecated) +#else +# define TOML11_MARK_AS_DEPRECATED +#endif + namespace toml {