const double & Waz::operator()(int i,int j) const
{
return ((WazImpl const)(*p))(i,j);
}
Where in Waz class I have : WazImpl* p; and in the class WazImpl I have an operator () const
The warning is : Warning C4172 returning address of local variable or temporary
As far as I understand I'm returning a temp variable which is destroyed somewhere else what can I do to fix it?
in what line do you have that warning?
Maybe in the WazImpl operator () ?
And, if p is of type WazImpl*, why do you cast it to WazImpl const ?
Could you post a minimal compilable piece of code that reproduce the problem?