Is this documented behaviour?

Dicebot public at dicebot.lv
Wed Jul 24 08:03:31 PDT 2013


On Tuesday, 23 July 2013 at 20:13:33 UTC, John Colvin wrote:
> To be honest, I wasn't expecting foo(*aptr) to compile at all, 
> with a "taking address of temporary" error or similar.

But there are no temporaries here. You seem to mix concepts of 
"temporary" and "stack variable with deterministic lifetime". 
Taking address of a temporary is something like this:

int foo() { return 42; }
...
int* ptr = &(foo());


More information about the Digitalmars-d-learn mailing list