Replies: 1 comment 3 replies
-
|
Note: We already have a macro to disable implicit conversions. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
As I can see adding of ordered_json added a lot of confusion.
#2539
#2528 (comment)
And I think that some of the confusion could be prevented via disabling potentially unwanted behaviour.
How about making cast from one basic_json type to another basic_json type explicit?
So
Won't longer compile and need explicitly cast it to desired type?
It's a breaking change, but it should be a good candidate for 4.0. Or it can be added as a new default behaviour with ability to have implicit casts via some define.
I think that code that doesn't compile should be a good hint that user did something wrong.
static_cast is ugly, but I'm sure most of such implicit conventions were made by mistake anyway, so broken code should be changed to use correct basic_json type.
Beta Was this translation helpful? Give feedback.
All reactions