Merge pull request #1208 from mabuchner/1207-cp-31-memory-corruption-from-example

Pass parameter as reference in CP.31 example
This commit is contained in:
Gabriel Dos Reis
2018-05-14 11:10:24 -07:00
committed by GitHub

View File

@@ -14130,12 +14130,12 @@ Defining "small amount" precisely is impossible.
##### Example
string modify1(string);
void modify2(shared_ptr<string>);
void modify2(string&);
void fct(string& s)
{
auto res = async(modify1, s);
async(modify2, &s);
async(modify2, s);
}
The call of `modify1` involves copying two `string` values; the call of `modify2` does not.