News for hackers. Stuff that matters.
Re:C++23: The Next C++ Standard by coldpie on Tuesday July 11, 2023 @03:31PM (#36686136)
They're functions. Whatever they do, my code will go execute some code from whatever library implements them, which is what a function does. I just want to be able to rely on [] being an array subscript when I read some unfamiliar code. Is that too much to ask?
Re:C++23: The Next C++ Standard by pjmlp on Tuesday July 11, 2023 @04:28PM (#36686799)
Just like the function that happens to be named [].
Re:C++23: The Next C++ Standard by kristiandupont on Wednesday July 12, 2023 @01:14AM (#36690686)
Can IDE's detect this and offer "go to implementation" on an overloaded operator these days? Because besides from the surprise-element in the fact that there even is code to debug hiding somewhere, not being able to quickly navigate to it is much worse in my opinion. And with infix operators where you can't even be sure which operand the implementation belongs to, figuring it out can be a bit of a detective task.
Re:C++23: The Next C++ Standard by pjmlp on Wednesday July 12, 2023 @02:56AM (#36691238)
Visual Studio does show a popup, go to implementation, and if the implementation happens to be visible on the same screen, also highlights it.
Re:C++23: The Next C++ Standard by circuit10 on Tuesday July 11, 2023 @07:23PM (#36688506)
If you’re using it right then [] is still an array subscript, just with a custom implementation for getting array elements