consider the function definition below:
auto& Fnc1() { return someNonLocalVariable; }
Return type is not explicitly specified by -> in this case. But there is the & after auto keyword. Does this guarantee that a reference is returned instead of copy of the variable? Is this a supported language feature (returning reference)? With VS 2017, it works as I expect: Return a reference. But I could not find any online source to verify.
Aucun commentaire:
Enregistrer un commentaire