Assigning to auto&& does some funky things
mika314 opened this issue · comments
This snippet does not work properly all the time:
auto &&version = library->get_as<std::string>("version").value_or("master");
Sometimes it works sometimes it does not.
Workaround: do std::string instead auto &&, like this:
std::string version = library->get_as<std::string>("version").value_or("master");
You cannot return by reference here, because alternative may be rvalue:
Line 91 in 13fb18e
Good catch! Should be fixed in 415b33f.