diff --git a/include/boost/json/detail/value_from.hpp b/include/boost/json/detail/value_from.hpp index 7f2e77c9..c14178bc 100644 --- a/include/boost/json/detail/value_from.hpp +++ b/include/boost/json/detail/value_from.hpp @@ -83,11 +83,13 @@ tag_invoke( // Generic conversions // string-like types +// NOTE: original check for size used is_convertible but +// MSVC-140 selects wrong specialisation if used template, const char*, std::size_t>::value && - std::is_convertible().data()), const char*>::value && - std::is_convertible().size()), - std::size_t>::value>::type* = nullptr> + std::is_convertible().data()), const char*>::value && + std::is_integral().size())>::value +>::type* = nullptr> void value_from_generic( value& jv, diff --git a/include/boost/json/detail/value_to.hpp b/include/boost/json/detail/value_to.hpp index 2708451a..bdf5401e 100644 --- a/include/boost/json/detail/value_to.hpp +++ b/include/boost/json/detail/value_to.hpp @@ -100,11 +100,13 @@ tag_invoke( // Use generic conversion // string-like types +// NOTE: original check for size used is_convertible but +// MSVC-140 selects wrong specialisation if used template::value && - std::is_convertible().data()), const char*>::value && - std::is_convertible().size()), - std::size_t>::value>::type* = nullptr> + std::is_convertible().data()), const char*>::value && + std::is_integral().size())>::value +>::type* = nullptr> T value_to_generic( const value& jv,