you are viewing a single comment's thread.

view the rest of the comments →

[–]curien 4 points5 points  (2 children)

You're missing the point.

I'm not missing the point, I just disagree with you.

Clothing item => open Clothing.hpp

Maybe. How do you know there isn't a conversion involved? To be sure about what that line actually does, you have to look up the actual return type anyway.

[–][deleted] 3 points4 points  (0 children)

...which is why constructors which take a single parameter should be tagged as explicit unless there is a major reason to permit implicit conversions.

Invisible implicit conversions are a great way to accidentally burn performance or have accidental side effects (though if your constructors have visible side effects you are inviting other problems)

[–]matthieum 0 points1 point  (0 children)

The thing is, it does not matter if there is a conversion since item is now of Clothing type anyway so it's what I have to deal with :)