-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Rename VariantZeroAssigner
to VariantDefaultInitializer
#59186
Conversation
I am wondering if this PR will make |
core/variant/variant_internal.h
Outdated
}; | ||
|
||
template <> | ||
struct VariantZeroAssigner<bool> { | ||
struct VariantDefaultInitializer<bool> { | ||
static _FORCE_INLINE_ void zero(Variant *v) { *VariantInternal::get_bool(v) = false; } |
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.
If this is approved, then zero
should also be renamed everywhere. But let's see what @reduz thinks first.
22040ae
to
89bce0e
Compare
89bce0e
to
e29f9b6
Compare
e29f9b6
to
29ad555
Compare
29ad555
to
3a4a33b
Compare
3a4a33b
to
316f139
Compare
Don't know how much of a compatibility breakage it will cause (if any), but can the |
d936653
to
7bbabac
Compare
7bbabac
to
d54c1a1
Compare
d54c1a1
to
a92e9c5
Compare
The change makes sense to me. Since it's an internal change it won't break compatibility. I do agree that the |
I'd just call it |
a92e9c5
to
9ab74d6
Compare
And the method zero() is now init()
9ab74d6
to
d48d3ea
Compare
Thanks! |
Discussed on RocketChat.
VariantZeroAssigner
's name indicates that it should assign zero, but it actually assigns the default value. For some types, such as Basis, Transforms, Color, Quat, the default value is non-zero. The new nameVariantDefaultInitializer
was suggested by @akien-mga.