Re: Policy Design
{ Reformatted; please limit your lines to 70 characters, and please
provide one or more small quotes to establish some context. -mod }
On Friday, July 20, 2012 8:43:17 PM UTC-4, Nevin :-] Liber wrote:
Played around with boost::bind/boost:;function for sometime but I'm
coming up short. Given:
test ca(boost::bind(user_defined_handler_A, _1));
where user_defined_A is defined as:
void user_defined_A ( A& ) {}
The composite types A and B are updated based on a read of an external
interface. More importantly, the user defined handler above expects
an A object, hence if the type read from the interface is B then I
dont want to invoke the user defined handler unnecessarily. The
question: Is there anyway to determine the type from the lambda within
the process function or ..if not the lambda .. how i can determine the
type of the user defined handler?
void process() const {
// pseudo code
type = get_type_from_interface() ;
if ( user_handler == a && type == a )
handler();
else {
// otherwise ignore
}
}
--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]