-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
src: use enum class
instead of enum
in node_i18n
#45646
src: use enum class
instead of enum
in node_i18n
#45646
Conversation
2ea515e
to
eb666b2
Compare
@@ -42,7 +42,7 @@ bool InitializeICUDirectory(const std::string& path); | |||
|
|||
void SetDefaultTimeZone(const char* tzid); | |||
|
|||
enum idna_mode { | |||
enum class idna_mode { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest removing the IDNA_
prefix from the members of idna_mode
since the scope is changing. For example, idna_mode::IDNA_STRICT
should just be idna_mode::STRICT
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think good suggestion from a clean code point of view. Removed IDNA_
prefix.
"enum class" has more advantages than "enum" because it's strongly typed and scoped. Refs: https://isocpp.org/wiki/faq/cpp11-language-types#enum-class
eb666b2
to
bc0541f
Compare
@tniessen BTW, I have one question about test. For now, |
bc0541f
to
5d4cb6f
Compare
Windows errors: https://github.com/nodejs/node/actions/runs/3561646551/jobs/5983757408#step:6:2624
|
This change is needed to fix error of window build.
Thanks to your sharing, I could find solution to avoid error of window build. |
This comment was marked as outdated.
This comment was marked as outdated.
Landed in 1750a94 |
"enum class" has more advantages than "enum" because it's strongly typed and scoped. Refs: https://isocpp.org/wiki/faq/cpp11-language-types#enum-class PR-URL: nodejs#45646 Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
"enum class" has more advantages than "enum" because it's strongly typed and scoped. Refs: https://isocpp.org/wiki/faq/cpp11-language-types#enum-class PR-URL: #45646 Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
"enum class" has more advantages than "enum" because it's strongly typed and scoped. Refs: https://isocpp.org/wiki/faq/cpp11-language-types#enum-class PR-URL: #45646 Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
"enum class" has more advantages than "enum" because it's strongly typed and scoped. Refs: https://isocpp.org/wiki/faq/cpp11-language-types#enum-class PR-URL: #45646 Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
"enum class" has more advantages than "enum" because it's strongly typed and scoped. Refs: https://isocpp.org/wiki/faq/cpp11-language-types#enum-class PR-URL: #45646 Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
"enum class" has more advantages than "enum" because it's strongly typed and scoped. Refs: https://isocpp.org/wiki/faq/cpp11-language-types#enum-class PR-URL: #45646 Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
"enum class" has more advantages than "enum" because it's strongly typed and scoped. Refs: https://isocpp.org/wiki/faq/cpp11-language-types#enum-class PR-URL: #45646 Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
"enum class" has more advantages than "enum" because it's strongly typed and scoped.
Refs: https://isocpp.org/wiki/faq/cpp11-language-types#enum-class