Best Practice: Alternatives to Void Pointers

Simen Kjærås simen.kjaras at gmail.com
Tue Jan 30 17:49:58 UTC 2018


On Tuesday, 30 January 2018 at 17:41:53 UTC, jsako wrote:
> So what's considered the best alternative to void pointers in D 
> if you don't want to use objects? Make a tagged Union of all 
> possible datatypes in the struct? Have a Byte array and cast 
> that instead of a void pointer? Some sort of magic involving 
> templates or other metaprogramming mechanisms?

https://dlang.org/phobos/std_variant.html

--
   Simen


More information about the Digitalmars-d-learn mailing list