Closed jojogh closed 4 years ago
In eval::operator()
, return expr;
returns an expression whose subexpressions are lvalue references to locals. You have a dangling reference problem.
many thanks
Zach Laine notifications@github.com 于2020年4月9日周四 上午7:21写道:
Closed #102 https://github.com/boostorg/yap/issues/102.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/boostorg/yap/issues/102#event-3216193827, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABCZJKRGYRK4ESO73GEVWTRLUBHJANCNFSM4KR2AW4A .
I made a small test on the yap, I made two simple plus expression templates under minial template example case. One is directly in a main function, and another is in a struct operator. As we expected, both results should be the small. In fact, it is not, if called the struct operator, the result is not 42, but a wired number. Is that a bug or I misunderstood it, and made wrong setting? I really looking forward to your replys, many thanks! @tzlaine @danieljames