Hacker News new | ask | show | jobs
by mmaldacker 4096 days ago
> While implicit operator overload was probably a C++ mistake

are you talking about the implicit conversion operator or operator overloading in C++?

For the former, it has been vastly improved in C++11 with the addition of explicit conversion operator. For the later, some very important capabilities of C++ rely on operator overloading namely the assignment operator (copy/move assignment) and the function operator (allows what C++ calls functors). Another useful thing with operator overloading is allowing the creation of generic functions that work on existing types (int, float, ..) and user defined types, for example std::accumulate.

1 comments

The main issue I have with them is "brave" libraries developers who think it is a great idea to overload ->, . and delete. This can create issues where the code you read doesn't actually do what it look to do. I know about smart pointers and all, but really, those "features" are misused.