diff --git a/include/nlohmann/detail/view/value.hpp b/include/nlohmann/detail/view/value.hpp index 64b05b254..b43a9c4df 100644 --- a/include/nlohmann/detail/view/value.hpp +++ b/include/nlohmann/detail/view/value.hpp @@ -40,7 +40,7 @@ converted with static_cast, booleans give 0 or 1, and other types throw type_error.302. */ template -T arithmetic_value(const document_data& d, const node& n) +NLOHMANN_VIEW_ALWAYS_INLINE T arithmetic_value(const document_data& d, const node& n) { switch (static_cast(n.kind)) { diff --git a/include/nlohmann/json_view.hpp b/include/nlohmann/json_view.hpp index 30330d073..d9e1ff836 100644 --- a/include/nlohmann/json_view.hpp +++ b/include/nlohmann/json_view.hpp @@ -512,7 +512,7 @@ class basic_json_view /// maps with string keys, and views are converted directly; other types /// through materialize().get() template - T get() const + NLOHMANN_VIEW_ALWAYS_INLINE T get() const { return get_impl(detail::view::value_tag {}, detail::priority_tag<2> {}); } @@ -599,7 +599,7 @@ class basic_json_view } template < typename T, typename std::enable_if < std::is_arithmetic::value && !std::is_same::value, int >::type = 0 > - T get_impl(detail::view::value_tag /*unused*/, detail::priority_tag<2> /*unused*/) const + NLOHMANN_VIEW_ALWAYS_INLINE T get_impl(detail::view::value_tag /*unused*/, detail::priority_tag<2> /*unused*/) const { if (NLOHMANN_VIEW_UNLIKELY(m_node == nullptr)) { diff --git a/single_include/nlohmann/json_view.hpp b/single_include/nlohmann/json_view.hpp index ae308dab1..d7547732a 100644 --- a/single_include/nlohmann/json_view.hpp +++ b/single_include/nlohmann/json_view.hpp @@ -2725,7 +2725,7 @@ converted with static_cast, booleans give 0 or 1, and other types throw type_error.302. */ template -T arithmetic_value(const document_data& d, const node& n) +NLOHMANN_VIEW_ALWAYS_INLINE T arithmetic_value(const document_data& d, const node& n) { switch (static_cast(n.kind)) { @@ -3249,7 +3249,7 @@ class basic_json_view /// maps with string keys, and views are converted directly; other types /// through materialize().get() template - T get() const + NLOHMANN_VIEW_ALWAYS_INLINE T get() const { return get_impl(detail::view::value_tag {}, detail::priority_tag<2> {}); } @@ -3336,7 +3336,7 @@ class basic_json_view } template < typename T, typename std::enable_if < std::is_arithmetic::value && !std::is_same::value, int >::type = 0 > - T get_impl(detail::view::value_tag /*unused*/, detail::priority_tag<2> /*unused*/) const + NLOHMANN_VIEW_ALWAYS_INLINE T get_impl(detail::view::value_tag /*unused*/, detail::priority_tag<2> /*unused*/) const { if (NLOHMANN_VIEW_UNLIKELY(m_node == nullptr)) {