I'm not an expert of C++ and i'm looking to the fastest way to return a value from a function. For example, for passing a value as a function arguemnt the fastest way is a const reference:
void foo(const bar& parameter);
Is possible to do something like this with return value? If i return a reference, maybe with something like this:
bar& foo();
Could i have any issue at runtime since the variable referred no longer exist (because the function foo has ended). Thank you in advice and sorry for my bad english