J
Jason Heyes
I am interested in the lifetime of a function argument in two cases. They
are:
1. void foo(Bar bar);
2. void foo(const Bar &bar);
In each case I call foo like so:
foo(Bar());
What is the lifetime of Bar() in each case? I suspect that Bar() exists for
the duration of foo(const Bar &) and does not exist at all during foo(Bar).
Is this correct?
are:
1. void foo(Bar bar);
2. void foo(const Bar &bar);
In each case I call foo like so:
foo(Bar());
What is the lifetime of Bar() in each case? I suspect that Bar() exists for
the duration of foo(const Bar &) and does not exist at all during foo(Bar).
Is this correct?