A
Andrew Tomazos
Please consider...
class C { ... }
void g(C& c) { ... alters state of c ... }
template <class F, class P>
void h(F f, P p)
{
f(p);
}
void main()
{
C c1;
h(g,c1);
}
The question is: will the local variable c1 be modified?
In other words, when the type P is calculated, will it be calculated
as 'C' or 'C&' ? and why?
Thanks,
Andrew.
class C { ... }
void g(C& c) { ... alters state of c ... }
template <class F, class P>
void h(F f, P p)
{
f(p);
}
void main()
{
C c1;
h(g,c1);
}
The question is: will the local variable c1 be modified?
In other words, when the type P is calculated, will it be calculated
as 'C' or 'C&' ? and why?
Thanks,
Andrew.