mirror of
https://github.com/arun11299/cpp-subprocess.git
synced 2025-09-10 15:56:48 -04:00
Fix string_arg when used with rref (#110)
When passing in a rvalue reference, compiler considers it ambiguous between std::string and std::string&&. Making one of them take a lvalue reference makes compilers correctly pick the right one depending on whether the passed in value binds to a rvalue or lvalue reference.
This commit is contained in:
parent
beda7b5244
commit
2d8a8eebb0
@ -708,7 +708,7 @@ struct string_arg
|
|||||||
{
|
{
|
||||||
string_arg(const char* arg): arg_value(arg) {}
|
string_arg(const char* arg): arg_value(arg) {}
|
||||||
string_arg(std::string&& arg): arg_value(std::move(arg)) {}
|
string_arg(std::string&& arg): arg_value(std::move(arg)) {}
|
||||||
string_arg(std::string arg): arg_value(std::move(arg)) {}
|
string_arg(const std::string& arg): arg_value(arg) {}
|
||||||
std::string arg_value;
|
std::string arg_value;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user