2 ms·
We've got a C++ codebase with its own path class, which works this way. They also used unary operator* (dereference operator) in the string class to return a po
by khedoros1 9y ago
We've got a C++ codebase with its own path class, which works this way. They also used unary operator* (dereference operator) in the string class to return a pointer to the underlying c-string. These are the "clever" kinds of things that the original devs used to get kind of sheepish about when I first brought them up.
- ktRolster 9y agoAt one time, operator overloading was encouraged. See for example, << in the cout command. Everyone was trying to think of new ways to use them.
- khedoros1 9y agoWell, and it worked well enough, in the limited context of our software system. There were a few quirks like that, that everyone knew about. It was kind of funny how opinions changed in the years between when it was written and when I started working there, though.