simendsjo simen.end...@pandavre.com wrote:
The spec is very short here, and the example doesn't give me much..
// I thought allows functinos to return by reference meant it could
return local variables..
ref int* ptr() {
auto p = new int;
*p = 12;
return p; // Error:
The spec is very short here, and the example doesn't give me much..
// I thought allows functinos to return by reference meant it could
return local variables..
ref int* ptr() {
auto p = new int;
*p = 12;
return p; // Error: escaping local variable
}
// So whats the
Hello simendsjo,
The spec is very short here, and the example doesn't give me much..
// I thought allows functinos to return by reference meant it could
return local variables..
ref int* ptr() {
auto p = new int;
*p = 12;
return p; // Error: escaping local variable
}
// So whats the difference
simendsjo wrote:
The spec is very short here, and the example doesn't give me much..
// I thought allows functinos to return by reference meant it could
return local variables..
ref int* ptr() {
auto p = new int;
*p = 12;
return p; // Error: escaping local variable
}
For free