Skip to content

Commit d7457d2

Browse files
committed
fix warning in older compilers
1 parent bf259eb commit d7457d2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

include/behaviortree_cpp/utils/safe_any.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -347,9 +347,9 @@ nonstd::expected<T, std::string> Any::stringToNumber() const
347347
{
348348
static_assert(std::is_arithmetic_v<T> && !std::is_same_v<T, bool>, "Expecting a numeric type");
349349

350-
auto str = linb::any_cast<SafeAny::SimpleString>(_any);
351-
T out;
350+
const auto str = linb::any_cast<SafeAny::SimpleString>(_any);
352351
#if __has_include(<GL/gl.h>)
352+
T out;
353353
auto [ptr, err] = std::from_chars(str.data(), str.data() + str.size(), out);
354354
if(err == std::errc())
355355
{

0 commit comments

Comments
 (0)