Ref<> objects must be nested by reference because they potentially store a temporary object

This commit is contained in:
Gael Guennebaud
2013-08-11 17:52:43 +02:00
parent c13e9bbabf
commit 6719e56b5b
4 changed files with 7 additions and 6 deletions

View File

@@ -604,7 +604,7 @@ atan2(const AutoDiffScalar<DerTypeA>& a, const AutoDiffScalar<DerTypeB>& b)
Scalar tmp4 = tmp3/(tmp2+tmp3);
if (tmp4!=0)
ret.derivatives() = (a.derivatives() * b.value() - a.value() * b.derivatives()) * (tmp2+tmp3);
ret.derivatives() = (a.value() * b.derivatives() - a.derivatives() * b.value()) * (tmp2+tmp3);
return ret;
}