
Matthew Vogt <mvogt <at> juptech.com> writes:
Anyway, I think some reasonably clean syntax can be found to bind both the arguments and the return address into the function call, provided that the return address is a method in the invoking object.
Well, after some fiddling, the best I can manage is: class SomeClass { public: std::string value(int id) { return "foo"; } } class ThatServant : public reactive<ThatServant>, private SomeClass { public: ThatServant() : getValue(&ThatServant::value, this) {} method<std::string (int)> getValue; }; class ThisServant : public reactive<ThisServant> { public: void findAndStoreValue(ThisServant& other, int id) { (return_to(&ThisServant::storeValue, this)) = other.getValue(int); } private: void storeValue(std::string value) { ... } } Matt