
On 10/04/13 19:43, Nathan Crookston wrote:
Hi Mathias,
Mathias Gaunard wrote:
I personally have my own implementation of result_of which does this. My
implementation is also simpler, compiles faster, is optionally optimized for compilers with variadic templates (also supports compilers with decltype but no variadic templates), has preprocessing support, and has the added benefit that result_of<Sig>::type is only defined if Sig is callable.
Sounds pretty slick. Is this in NT2, or just in some other code you have?
Yes. I've found that boost::result_of is often a performance bottleneck. Unfortunately the code in Boost is not as simple as it could be; it instantiates way too many templates, I suppose for legacy purposes. My version could probably still be improved too.
I actually gave this a try with some code that used to cause the decltype-based boost::result_of problems. It worked well, not matter which
Hi Mathias,
Mathias Gaunard wrote:
preprocessor symbols I defined. The code and the later fix were both
provided by Eric Niebler, btw (I made minor modifications).
#define USE_RESULT_OF
//#define BOOST_RESULT_OF_USE_DECLTYPE
#define BOOST_RESULT_OF_USE_TR1
#ifndef USE_NT2_RESULT_OF
# include