logoalt Hacker News

leleletoday at 4:35 PM3 repliesview on HN

> y'know you can check if an operator has been overloaded

And there lies the problem with C++: to be sure, you have to check. C++ code can't be taken at face value -- the most innocuous-looking code could be a ticking bomb.


Replies

pjmlptoday at 5:03 PM

Just like any C function without looking into the translation unit, don't say you blindly believe on the function name.

show 1 reply
rfgplktoday at 4:58 PM

But isn't this a problem with all code? Looking at a Rust function signature how can you be sure that it does what it says it does? Or python?

show 1 reply
LoganDarktoday at 4:53 PM

> C++ code can't be taken at face value -- the most innocuous-looking code could be a ticking bomb.

You can't take C code at face value either. The name of a method or type doesn't tell you what it does. It could longjmp for all you know.

show 1 reply