From e60e458a7e7d9fe6a18fabfc3930711483afb74f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20DELRIEU?= Date: Sun, 15 Jan 2017 21:18:58 +0100 Subject: [PATCH] move static_const to the detail namespace --- src/json.hpp | 25 ++++++++++++------------- src/json.hpp.re2c | 25 ++++++++++++------------- 2 files changed, 24 insertions(+), 26 deletions(-) diff --git a/src/json.hpp b/src/json.hpp index 2457f5d7..8e14b5cd 100644 --- a/src/json.hpp +++ b/src/json.hpp @@ -797,6 +797,16 @@ public: } }; +// taken from ranges-v3 +template +struct static_const +{ + static constexpr T value{}; +}; + +template +constexpr T static_const::value; + /*! @brief helper class to create locales with decimal point @@ -818,21 +828,10 @@ struct DecimalSeparator : std::numpunct }; } -// taken from ranges-v3 -// TODO add doc -template -struct static_const -{ - static constexpr T value{}; -}; - -template -constexpr T static_const::value; - inline namespace { -constexpr const auto & to_json = static_const::value; -constexpr const auto & from_json = static_const::value; +constexpr const auto & to_json = detail::static_const::value; +constexpr const auto & from_json = detail::static_const::value; } // default JSONSerializer template argument, doesn't care about template argument diff --git a/src/json.hpp.re2c b/src/json.hpp.re2c index 4dbeda8a..f4d0cf8d 100644 --- a/src/json.hpp.re2c +++ b/src/json.hpp.re2c @@ -797,6 +797,16 @@ public: } }; +// taken from ranges-v3 +template +struct static_const +{ + static constexpr T value{}; +}; + +template +constexpr T static_const::value; + /*! @brief helper class to create locales with decimal point @@ -818,21 +828,10 @@ struct DecimalSeparator : std::numpunct }; } -// taken from ranges-v3 -// TODO add doc -template -struct static_const -{ - static constexpr T value{}; -}; - -template -constexpr T static_const::value; - inline namespace { -constexpr const auto & to_json = static_const::value; -constexpr const auto & from_json = static_const::value; +constexpr const auto & to_json = detail::static_const::value; +constexpr const auto & from_json = detail::static_const::value; } // default JSONSerializer template argument, doesn't care about template argument