feat: workaround __cplusplus problem on MSVC

This commit is contained in:
ToruNiina
2021-12-17 22:29:57 +09:00
parent 40777070ad
commit 02fd8a577b
13 changed files with 71 additions and 32 deletions

View File

@@ -7,8 +7,9 @@
#include <utility>
#include "traits.hpp"
#include "version.hpp"
#if __cplusplus >= 201402L
#if TOML11_CPLUSPLUS_STANDARD_VERSION >= 201402L
# define TOML11_MARK_AS_DEPRECATED(msg) [[deprecated(msg)]]
#elif defined(__GNUC__)
# define TOML11_MARK_AS_DEPRECATED(msg) __attribute__((deprecated(msg)))
@@ -21,7 +22,7 @@
namespace toml
{
#if __cplusplus >= 201402L
#if TOML11_CPLUSPLUS_STANDARD_VERSION >= 201402L
using std::make_unique;
@@ -33,7 +34,7 @@ inline std::unique_ptr<T> make_unique(Ts&& ... args)
return std::unique_ptr<T>(new T(std::forward<Ts>(args)...));
}
#endif // __cplusplus >= 2014
#endif // TOML11_CPLUSPLUS_STANDARD_VERSION >= 2014
namespace detail
{
@@ -91,7 +92,7 @@ T from_string(const std::string& str, T opt)
namespace detail
{
#if __cplusplus >= 201402L
#if TOML11_CPLUSPLUS_STANDARD_VERSION >= 201402L
template<typename T>
decltype(auto) last_one(T&& tail) noexcept
{