Re:Are Implicit Operators a Path to Clean Code or a Buggy Ni...
by Guvante on Wednesday August 09, 2023 @12:10AM
(#37058598)
Having a vector with a sized based constructor transform an integer into a vector is surprising.
[ Parent
| on HN ]
Re:Are Implicit Operators a Path to Clean Code or a Buggy Ni...
by gumby on Wednesday August 09, 2023 @02:42AM
(#37059412)
Yeah, I find that weird too — everybody does. It’s a legacy of the early 90s.
But the case under discussion is single-argument constructors, which can also be considered conversion operators.
Re:Are Implicit Operators a Path to Clean Code or a Buggy Ni...
by Guvante on Friday August 11, 2023 @02:52AM
(#37085866)
No, the topic was "implicit isn't the right default"
It was a mistake that can't be fixed saying "C++ doesn't need implicit as a keyword so it is better" is wrong when explicit is the better default if you need one.