Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

希望去掉所有头文件及生成头文件中的using namespace std #278

Open
morebtcg opened this issue Jun 11, 2023 · 2 comments
Open

Comments

@morebtcg
Copy link

morebtcg commented Jun 11, 2023

tars的大量头文件中使用了using namespace std,tars2cpp生成的头文件也不例外
不仅仅是std,有些地方还using namespace tup

目前只要包含了这些头文件,就会导致部分项目编译失败

希望能去掉tars源码中所有的using namespace,tarscpp增加一个生成选项,允许生成不带using namespace的头文件代码

@ruanshudong
Copy link
Contributor

是有这个问题, 但是一旦改动会导致历史业务服务代码都编译不过, 所以为了兼容历史就一直没有调整了

@morebtcg
Copy link
Author

morebtcg commented Jun 13, 2023

tars框架自身代码的std可以去掉,理论上不影响历史,如果真有历史代码依赖了tars框架的std,那也可以做成tars框架编译选项
tars2cpp可以增加选项(默认关),打开后才去掉std,这样就可以兼容历史代码了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants