-
Notifications
You must be signed in to change notification settings - Fork 918
Fixed #521. #531
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
Fixed #521. #531
Conversation
Introduced new object type `FLOAT32` and `FLOAT64`. `FLOAT64` is equivalent to `FLOAT`. The both internal expressions are f64(double).
|
This PR will fix #521. It is a breaking change but very subtle.
I guess that all cases do NOT make big impact for existing client codes. When creating and packing, existing client codes only use When unpacking, if a client code compare the However, it is easy to migrate as follows: Replace if (obj.type == msgpack::type::FLOAT) {
}with if (obj.type == msgpack::type::FLOAT32 || obj.type == msgpack::type::FLOAT64) {
}After applying the PR, if (obj.type == msgpack::type::FLOAT32 || obj.type == msgpack::type::FLOAT) {
}I recommend to use If you convert using @mika-fischer , is this satisfied you usecase? I think that it is a breaking change but doesn't make a big impact. So I don't think the major version up is required e.g.) 3.0.0. I think that we can release it as 2.1.0. @nobu-k, what do you think? |
|
@redboltz Wow, thanks, looks good! |
|
@nobu-k, what do you think? I will merge it to master. I'd like to hear your idea of backward compatibility. |
|
I think this change does have a big impact on users who have already used
So, if we want to release this as v2.1.0, we have to make a clear announcement about the change and provide a migration guide you wrote above. By the way, is there any way to produce a warning at the compile time if |
since C++14, we can do that as follows: |
|
For old compilers, we can introduce the macro MSGPACK_DEPRECATED. http://melpon.org/wandbox/permlink/TlKE5kdGVND2W5xj #if __cplusplus >= 201402L
#define MSGPACK_DEPRECATED [[deprecated]]
#else
#define MSGPACK_DEPRECATED
#endif
enum {
A,
B MSGPACK_DEPRECATED,
C
};
int main() {
int a = A;
int b = B;
int c = C;
(void)a;
(void)b;
(void)c;
} |
|
Looks great! |
|
I will merge the PR without deprecated marking. After I do it, I will write the new PR for deprecated marking. I created the issue for that #534 The reason that I separate the deprecated marking from the PR, there are some places that should be marked as deprecated, not only the PR. |
Introduced new object type
FLOAT32andFLOAT64.FLOAT64is equivalent toFLOAT.The both internal expressions are f64(double).