問題描述
我想調試一些模板化代碼以更好地理解它.
不幸的是,我是模板元編程的新手,我很難進入.
I would like to debug some templated code to understand it better.
Unfortunately I'm new to template metaprogramming and it IS hard for me to get in.
當我嘗試輸出預處理的源文件時,我得到了 125 000 行代碼:/
When I try to output the preprocessed source files I get 125 000 lines of code :/
那么有沒有辦法可以看到生成的代碼?(我使用的庫是 SeqAn)
So is there a way I can see the generated Code? (The library I'm using is SeqAn)
推薦答案
不,不是.預處理器與模板處理無關,由編譯器執行.模板不會生成 C++ 代碼,就像函數調用一樣 - 它們是 C++ 語言本身不可或缺的一部分.
No it isn't. The preprocessor has nothing to do with template processing, which is performed by the compiler. Templates do not generate C++ code, any more than a function call does - they are an integral part of the C++ language itself.
這篇關于C++ 模板元編程 - 是否可以輸出生成的代碼?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!