New programming paradigm
apz28 via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Thu Sep 7 12:33:01 PDT 2017
On Thursday, 7 September 2017 at 17:13:43 UTC, EntangledQuanta
wrote:
> On Thursday, 7 September 2017 at 15:36:47 UTC, Jesse Phillips
> wrote:
>> [...]
>
> All types have a type ;) You specified in the above case that m
> is an int by setting it to 4(I assume that is what var(4)
> means). But the downside, at least on some level, all the
> usable types must be know or the switch cannot be
> generated(there is the default case which might be able to
> solve the unknown type problem in some way).
>
> [...]
Nice for simple types but fail for struct, array & object
Current variant implementation is lack of type-id to check for
above ones. For this lacking, is there a runtime (not compile
time - trait) to check if a type is a struct or array or object?
Cheer
More information about the Digitalmars-d-learn
mailing list