What is the reasoning behind the lack of conversions when passing parameters

Walter Bright newshound2 at digitalmars.com
Wed Feb 14 19:30:36 UTC 2024


On 2/14/2024 9:46 AM, Carl Sturtivant wrote:
> Informally Any would be the sum of all types. Would your proposal encompass this?

No, each type would have to be enumerated in the declaration.

The usual way to do an Any type is to:

1. use Object as the common ancestor

2. use iUnknown as the common ancestor with QueryInterface

3. use void*

4. dmd internally uses its own RootObject for Any

5. use templates with a generic type T


More information about the Digitalmars-d mailing list