-
Notifications
You must be signed in to change notification settings - Fork 183
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
Unify the coding style of using size_t or std::size_t #114
Comments
I made a quick and little stat: llvm-project$ rg 'std::size_t' --glob '*.cpp' --no-heading | wc -l
3921
llvm-project$ rg '[^:]size_t' --glob '*.cpp' --no-heading | wc -l
18011
llvm-project$ git rev-parse HEAD
3d7b853233580527245eba885000dbf468983eb4 In this case, According to the result, both FYI, in my personal flavour, I prefer |
@xlinsist @Origami404 Thanks for the topic and discussion! I used a casual style for this point, and I think we do need a unified convention. The general convention in my mind are:
In general, the key is to make our code clear and maintainable, while avoiding naming conflicts and other issues that can arise from overusing the using directive. |
That's really cool! I did do a tally on llvm project but not as decent as it is.
It sums it up. The essence of the convention is to distinguish the so-called |
size_t
andstd::size_t
are both aliases ofunsigned long
in normal cases but defined in different standards. Though differences between them are subtle, unifications of usage is good for code style and code readability. Should we need clarification about it?Currently buddy-mlir is using
size_t
andstd::size_t
combinely (e.g. in Container.cpp), which is somethat misleading and one is better to be replaced with the other. @meshtag and I have discussed about it and summarized thatstd::size_t
is more friendly and simple for the compiler whilesize_t
is neater for developers to use. Considerations remain open.The text was updated successfully, but these errors were encountered: