Skip to content

Commit 514da4e

Browse files
author
romankoshelev
committed
fix all: FromString<long double> with libstdc++ before 13.1
commit_hash:4feb6e629a77c058f2770ee0aa2c8d3f1a4325ca
1 parent 4d82bc7 commit 514da4e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

universal/include/userver/utils/from_string.hpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@ struct IsFromCharsConvertible<
3333
std::void_t<decltype(std::from_chars(std::declval<const char*>(), std::declval<const char*>(), std::declval<T&>())
3434
)>> : std::true_type {};
3535

36+
// libstdc++ before 13.1 parse long double incorrectly
37+
#if defined(_GLIBCXX_RELEASE) && _GLIBCXX_RELEASE < 13
38+
template <>
39+
struct IsFromCharsConvertible<long double> : std::false_type {};
40+
#endif
41+
3642
template <class T>
3743
inline constexpr bool kIsFromCharsConvertible = IsFromCharsConvertible<T>::value;
3844

0 commit comments

Comments
 (0)