Replies: 2 comments 1 reply
-
|
I would definitely support Supporting it for type functions would make sense and be consistent. but in case of ambiguity (eg: expression structures have an For actual structures, I don't think an implicit cast is palatable, but I might be wrong, I just can't think of good examples. Regarding
and C3 has |
Beta Was this translation helpful? Give feedback.
-
|
What we are talking about here is some sort of inheritance structure , so is a relation. That would mean we should only these conversions for full members and not pointer members (since pointers imply a has a relation). I would like to focus on the conversions first, whether we want anonymous members is another discussion ;) Update: WOW that didn't take long before an issue popped up! An implicit conversion between Foo and i32 is not what you would want. This could cause lots of weird bugs. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
The idea is to allow conversion from Struct to its first member instead of forcing the user to use 'cast'.
So
There are 2 situations:
Also 2 conversions:
Things to consider:
Advantages of this would be:
Disadvantages:
Beta Was this translation helpful? Give feedback.
All reactions