19 Jul
2019
19 Jul
'19
11:03 a.m.
navya deepika garakapati wrote:
Hi Devs, consider below reduced testcase from boost lamda.
$cat result_of_tests.cpp
#include
#include template typename boost::result_of ::type apply1(F f, A b) { return f(b); } using namespace boost::lambda; int main(int, char *[]) { int one = 1; int d= (apply1<int>(_1 ,one) == 1); printf("\n%d\n",d); return 0; }
f(b) returns a reference to b, which goes out of scope at the closing brace; the example has undefined behavior. You should report this as an issue at https://github.com/boostorg/lambda/issues.