bind visit_each and obtaining argument values from bind

Am I correct that the bind visit_each functionality briefly mentioned in the boost::bind documentations will allow me to get at actual argument values passed to a bind statement? That would be VERY useful to me at the moment. Is there a working example? The bind_visitor.cpp example seems to be broken(?). thanks, braddock

Braddock Gaskill wrote:
Am I correct that the bind visit_each functionality briefly mentioned in the boost::bind documentations will allow me to get at actual argument values passed to a bind statement?
That would be VERY useful to me at the moment.
Is there a working example? The bind_visitor.cpp example seems to be broken(?).
bind_visitor seems pretty outdated. You can make it compile by removing its visit_each definition in namespace boost and the int/long parameters of the two operator() overloads in visitor.

On Thu, 05 Apr 2007 00:31:21 +0300, Peter Dimov wrote:
Braddock Gaskill wrote:
Am I correct that the bind visit_each functionality briefly mentioned in the boost::bind documentations will allow me to get at actual argument values passed to a bind statement?
bind_visitor seems pretty outdated. You can make it compile by removing its visit_each definition in namespace boost and the int/long parameters of the two operator() overloads in visitor.
That works nicely, thanks Peter! Is it possible to do a visit_each on a bind result assigned to a boost::function? boost::function<long (long, long)> func = bind(add, 7, 9); viistor v; visit_each(v, func); All I get is: Value of type N5boost8functionIFlllESaIvEEE (using the visitor from bind_visitor.cpp) Thanks, Braddock

Braddock Gaskill wrote:
Is it possible to do a visit_each on a bind result assigned to a boost::function?
boost::function<long (long, long)> func = bind(add, 7, 9); viistor v; visit_each(v, func);
I don't think that it's possible. boost::function<> erases the type of the contained object in a manner that makes the above very hard, if not impossible.
participants (2)
-
Braddock Gaskill
-
Peter Dimov