开发者

template paradigm and explicit warning

开发者 https://www.devze.com 2023-01-13 22:11 出处:网络
I was trying to compile a short example program ( 134 lines ) making extensive use of templates, and got nothing less than 500 lines of mysterious code really deep inside the template library, which i

I was trying to compile a short example program ( 134 lines ) making extensive use of templates, and got nothing less than 500 lines of mysterious code really deep inside the template library, which is quite annoying and开发者_StackOverflow中文版 useless.

My point isn't how to solve this issue (most probably add the appropriate path to the project..), but I had this problem several times already, and so I have rather an open question in mind : is there any way to improve the understandability of template-related warnings ? Do you experience similar issues ? How do you usually solve them ?


From wikipedia:

Error messages involving templates tend to be very long and difficult to decipher. This problem has been considered so severe that a number of tools have been written which simplify and prettyprint STL-related error messages to make them more comprehensible.

There are tools to improve the understandability of such error messages, most notable stlfilt.

0

精彩评论

暂无评论...
验证码 换一张
取 消