Re: vibe.d Serialize/Deserialize SumType to/from json

2022-07-04 Thread Paul Backus via Digitalmars-d-learn
On Monday, 4 July 2022 at 11:35:24 UTC, Antonio wrote: (or a way for creating a custom struct "inheriting" SumType with serialization capabilities)? You can "inherit" from a struct using `alias this`: ```d struct CustomStruct { SumType!(A, B, C) unwrap; alias unwrap this; // seria

vibe.d Serialize/Deserialize SumType to/from json

2022-07-04 Thread Antonio via Digitalmars-d-learn
D offers `SumType` struct to manage tagged Union types. But there is no support for managing it's Json serialization/deserialization (using vibe.d) Is it a way to add `fromRepresentation` and `toRepresentation` to `SumType` (or a way for creating a custom struct "inheriting" SumType with ser

Re: How to call a function from a dll created with d ?

2022-07-04 Thread frame via Digitalmars-d-learn
On Sunday, 3 July 2022 at 16:48:52 UTC, frame wrote: Only the -H switch or manual linker command generates a valid link to the DLL with DMD but then it's missing all the other library contents (also it needs `SimpleDllMain` or bails out linking errors to `_calloc` and Windows symbols) :\ `dm