我可以在不使用标题(重复函数声明)的情况下编写C ++代码吗? [英] Can I write C++ code without headers (repetitive function declarations)?
本文介绍了我可以在不使用标题(重复函数声明)的情况下编写C ++代码吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有没有办法不必编写函数声明两次(头文件),并且在编译时仍然保持相同的可缩放性,调试的清晰度和设计的灵活性? class =h2_lin>解决方案
使用 Lzz 。它需要一个文件,并在正确的位置为所有声明/定义自动创建.h和.cpp。
Lzz功能非常强大,可以处理99%的完整C ++语法,包括模板,专业化等等等等等等。
更新150120:
较新的C ++'11/14语法只能在Lzz函数体内使用。
Is there any way to not have to write function declarations twice (headers) and still retain the same scalability in compiling, clarity in debugging, and flexibility in design when programming in C++?
解决方案
Use Lzz. It takes a single file and automatically creates a .h and .cpp for you with all the declarations/definitions in the right place.
Lzz is really very powerful, and handles 99% of full C++ syntax, including templates, specializations etc etc etc.
Update 150120:
Newer C++ '11/14 syntax can only be used within Lzz function bodies.
这篇关于我可以在不使用标题(重复函数声明)的情况下编写C ++代码吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文