Tuesday 15 January 2013

c++ - Is there a template debugger? -



c++ - Is there a template debugger? -

templates can programs in themselves.

is there template debugger can step thru "execution" of template?

this have done during compile/link/codegen - , distinct debugging generated program.

even in many "primitive" environments cannot utilize debugger, can "printf debugging". possible templates?

edit: way think c preprocessor. useful generate "preprocessed" source code - output preprocessor compiler compiling - lets see effect macros having. template equivalent great - have compiler output non-template source code cooresponds templated input. closest can suppose c++ c translator. (doesn't comeau compiler this?)

you might want @ this patch clang outputs template instantiations.

another simple tool error messages compiler produces attempting instantiate undefined template.

template< typename > struct td; template< typename t > void your_template_function( t & param ) { // both of these produce error "undefined type td< t > t = ..." td< t > test1; td< decltype( param ) > test2; }

this explained in scott meyers cppcon talk, right after ring-tailed lemur slide.

c++ template-meta-programming

No comments:

Post a Comment