
20 Apr
2009
20 Apr
'09
3:31 p.m.
Sid Sacek <ssacek <at> securewatch24.com> writes:
struct ttt { int one; } test ;
test.one = 55; int *one_ref = &test.one; BOOST_SCOPE_EXIT( ( one_ref ) ) { *one_ref = 666; // experimental code } BOOST_SCOPE_EXIT_END;
This solves my problem. What really surprised me however was that when I made 'one_ref' an int&, the original test.one variable never got modified. Some other ( I assume temp variable ) was modified. If you're wondering what this is about, I'm trying to create a new macro that uses your macro.
Regards, -Sid Sacek
Try passing one_ref by reference: BOOST_SCOPE_EXIT( (&one_ref ) ) // ^ <=========== HERE Alex