-
-
Notifications
You must be signed in to change notification settings - Fork 580
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
Use namespace in defs.hpp #1617
base: master
Are you sure you want to change the base?
Conversation
a639a78
to
0d5c2e0
Compare
I think this is enough reason to consider not doing this. The other two ( |
I don't think |
I'd rather have |
It's also possible to have an interim deprecated using real_t [[deprecated("Moved to godot namespace")]] = godot::real_t; to ease migration, and remove it after some time. |
Ok! I think I'd be willing to go along with this if we had compatibility per @Bromeon's suggestion above. I wonder if we should have a |
I just experimented with this idea and found one drawback. "using namespace godot" cannot eliminate this warning. Although I am not one of the fans of this style, but I think they have right to have a clean compilation log as they are not doing wrong. namespace godot {
typedef float real_t;
}
using real_t [[deprecated("real_t has been moved to godot namespace")]] = godot::real_t;
using namespace godot;
int main() {
real_t a;
return 0;
} A compromise would be leaving this using statement without deprecation warning, so we have the namesapce and nothing breaks, and we may consider removing this orphan in the future. |
A global alias of godot::real_t is defined for backward compatibility
0d5c2e0
to
450c3d6
Compare
I did find another workaround: While deprecating Still, there is one drawback to moving |
It indeed works, but I don't feel good about the idea of forcing people to write both "using namespace godot" and "using godot::real_t;", which is quite weird. As for the inconsistency you mentioned, unlike godot-cpp, and not just real_t, the upstream simply has nothing in the namesapce at all, so it shouldn't be a concern. |
Yeah, I think keeping the |
Code in
defs.hpp
is not in namespacegodot
and I don't see any reason for that. Fixing the namesapce has no effect to the other files in the library as they are already in it. From users' perspective they will need to add prefixgodot::
toreal_t
,IndexSequence
,BuildIndexSequence
if they don't useusing namespace godot;
(like me). This breaks the compatibility to the old versions but the impact should be small.