-
|
Hi! https://godbolt.org/z/T178Gxcq7 It seems that somewhere between 3.11.1 and 3.12 there was some change so now the compiler is somehow able to find default I've tried to look into it myself but I couldn't find any changes that may caused this, and tbh I don't really understand how come it works in the first place currently. Because as far as I can see we shouldn't be able to find So I would really appreciate if someone could explain how does it work and if its the intended behavior. Happy new year btw! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
|
CE shows that It's calling this function: which is found here: I'm not sure exactly why it's finding that in the detail namespace given the types involved. Perhaps because it's a template function and the |
Beta Was this translation helpful? Give feedback.
-
|
I think I found a reason I doubt this side-effect was intended by the change above, so I guess it would be a bad idea to rely on it. Although there are already couple of places in our project (that I know of) that work only because of this :))). |
Beta Was this translation helpful? Give feedback.
I think I found a reason
Its because
basic_jsonnow derives fromnlohmann::detail::json_base_class, introduced hereBase class is one of the "associated entities" for ADL, and it includes its innermost namespace other than the lookup set, so that's why
nlohmann::detailsis exposed to ADL now.I doubt this side-effect was intended by the change above, so I guess it would be a bad idea to rely on it. Although there are already couple of places in our project (that I know of) that work only because of this :))).