|
|
|
|
|
by dwattttt
452 days ago
|
|
> Not necessarily, because you might consider it acceptable for the implicit conversion to change the memory layout in this sense. Does the actual data layout impact the observation? If you have A, something that accepts B, and you consider it implicitly possible for an A to be a B with either no change or an implicit change... that seems to amount to considering As to be Bs when necessary. |
|
The fact that an A can be implicitly converted to a B in this context does not mean that an A should always be implicitly converted to B. (In this case B is effectively a pointer/reference to A; implicitly forming that reference is a useful convenience feature in some contexts, but I don't think treating A as a subtype of reference to A in the general case is a good idea)