AMDG Zachary Turner wrote:
Thanks. On a related note, if a lambda placeholder refers to a structure, is there any way to access its members short of using bind and making a fake function to perform the access?
For example
struct foo { int x; int y; }; struct bar { int x, int y; };
foo f;
options.add_options() ("test", value<bar>()->notifier( var(f.x) = _1.x)));
is what I want. I've tried a variety of different things, most promising seemed to be
options.add_options() ("test", value<bar>()->notifier( var(f.x) = bind(&bar::x, _1)));
but this doesn't work either.
It ought to work. What's the error?
The following works for me:
#include