
9 Apr
2009
9 Apr
'09
1:49 a.m.
Steven Watanabe wrote:
AMDG
troy d. straszheim wrote:
Here's a possible interface for a boost::mpl-ized version of Steven Watanabe's template_profiler:
#define BOOST_MPL_ENABLE_TRACE #include "trace.hpp"
// // classes peppered with traces // template <typename T> struct traceme { BOOST_MPL_TRACE(traceme<T>); };
<snip>
The trace.hpp is attached, tested on gccs 4.3 and 4.2.
Unfortunately this doesn't work well with function templates
Hrm, quite right.
and it's more difficult to generate automatically.
I suppose I wasn't really thinking about 'profiling' total number of template instantiations, more about getting template stack traces while debugging... well maybe I wasn't thinking at all, I just wanted to have a go at it. -t