|
Boost : |
Subject: Re: [boost] Checking for return types (result_of) - redux..
From: Edward Grace (ej.grace_at_[hidden])
Date: 2009-08-21 11:17:27
Hi Robert,
>> "ordinary functions are fine but make sure you define a return_type
>> typedef in your functions oh.. and make sure the return type of the
>> operator()() is the same as that... " Then I have to add a way of
>> sanely catching if they have not done this - I doubt I can... Crazy!
>
> Why not define your code to take a boost::function<double(/*
> whatever goes here */)>?
That well be the way to go. It's worth a shot... I was (still am
slightly) reluctant to do this for the following reasons.
a) I think minimising interdependencies (#includ ing stuff) is a good
idea, of course that grand idea got drop kicked out of the window
ages ago. I'm #include <boost/....>'d to the eyeballs now, one more
won't hurt!
b) It's for a generic function timer code, for measuring the relative
performance of functions. Therefore I wanted to try and keep any
cruft surrounding the callee as minimal as possible -- at least until
I can be reasonably sure it has no impact.
I'll give it a bash and see,
Cheers,
-ed
------------------------------------------------
"No more boom and bust." -- Dr. J. G. Brown, 1997
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk