Skip to content

Commit

Permalink
Use feature test macro to check availability of std::from_chars
Browse files Browse the repository at this point in the history
  • Loading branch information
chhtz committed Oct 20, 2023
1 parent d7457d2 commit 751b5be
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/behaviortree_cpp/utils/safe_any.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ nonstd::expected<T, std::string> Any::stringToNumber() const
static_assert(std::is_arithmetic_v<T> && !std::is_same_v<T, bool>, "Expecting a numeric type");

const auto str = linb::any_cast<SafeAny::SimpleString>(_any);
#if __has_include(<GL/gl.h>)
#if __cpp_lib_to_chars >= 201611L
T out;
auto [ptr, err] = std::from_chars(str.data(), str.data() + str.size(), out);
if(err == std::errc())
Expand Down

0 comments on commit 751b5be

Please sign in to comment.