NHacker Next
  • new
  • past
  • show
  • ask
  • show
  • jobs
  • submit
Investigating an argument-dependent lookup issue and working around it (devblogs.microsoft.com)
ch33zer 3 days ago [-]
ADL hits the sweet spot of absolutely critical feature for C++ to be even remotely workable and a horrible anti feature that causes surprising behavior at a distance. So, critical and horrible at the same time. I think things like this are why C++ will lose over time
misnome 3 days ago [-]
Recently discovered this behaviour, I think I had just always assumed that e.g. operator<< was declared linked to the class, rather than just in a randomly searched namespace.

We were using the fmt library, and had `using namespace fmt` so that we could just call print(), format() directly. Suddenly, some of our calls (all that used std::strings as arguments) started failing as "ambiguous". We traced it to an updated dependency that... now included <chrono>. chrono includes format as part of it's formatting capabilities, so the compiler knows that the namespace object exists.

I find it crazy that it's impossible to bypass and say "no, I really do want this name". This seems to entirely defeat the point of namespaces. Now we have to have fmt:: sprinkled everywhere.

Fuck'n language.

lostmsu 2 days ago [-]
In C# you can do `using XXX = qualified.XXX`. Is there nothing like that in C++?
Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact
Rendered at 04:19:45 GMT+0000 (Coordinated Universal Time) with Vercel.