开发者

C++: Tool to reduce compile-time dependencies automatically

开发者 https://www.devze.com 2023-01-26 17:58 出处:网络
After reading about the pimpl idiom I was horrified开发者_如何学C! Isn\'t there a tool out there that can inspect a .h/.cpp file and deduce what dependencies could be waivered?Sorry, but no there isn

After reading about the pimpl idiom I was horrified开发者_如何学C!

Isn't there a tool out there that can inspect a .h/.cpp file and deduce what dependencies could be waivered?


Sorry, but no there isn't. C++ still relies on preprocessing source files, very mechanical. Large-scale C++ development is all about reducing the dependencies. In my opinion, C++ is simply not suitable for those kinds of tasks.


Does precompiling the headers not solve many of these horrors. Both MS and g++ support these now.


Static code inspection for C++ is a nightmare, because of its syntax and macro preprocessor, I doubt there are tools like the one you describe.

If it existed, what would you expect from it? Would you like it to refactor/rewrite code for you? Adding and/or removing what?

Sounds like a daunting task to me.

0

精彩评论

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