-
-
Notifications
You must be signed in to change notification settings - Fork 193
Open
Description
Hello,
you have this in reflect_traits_gen.hpp:
template <typename T, typename U>
void set_member(T&& val, U& result)
{
result = std::move(val);
}
Xcode flags std::move here, that it should be std::forward:
.../jsoncons/include/jsoncons/reflect/reflect_traits_gen.hpp:65:14: warning: Forwarding reference passed to std::move(), which may unexpectedly cause lvalues to be moved; use std::forward() instead [bugprone-move-forwarding-reference]
65 | result = std::move(val);
| ^
1 warning generated.
So maybe Xcode (clang) is right and it should be std::forward or maybe add a comment to remind us why not.