vgvassilev / clad

clad -- automatic differentiation for C/C++
GNU Lesser General Public License v3.0
266 stars 113 forks source link

Potential pitfall when passing the result of unary operation `+` on a lambda to `clad::differentiate` #966

Open thelfer opened 2 days ago

thelfer commented 2 days ago

Following discussion #963, this issue reports a potential pitfall when passing the result of unary operation + on a lambda to clad::differentiate.

Currently, as explained by @gojakuch in #963 , the best solution is not to use the unary operation to retrieve the address of the call operator of the lambda and directly pass the lambda to clad::differentiate.

This issue has only been opened for the records. Feel free to close it as this is mostly a corner case.