July 04, 2022 Learn » vibe.d Serialize/Deserialize SumType to/from json | |||
|---|---|---|---|
| |||
D offers `SumType` struct to manage tagged Union types. But there is no support for... | |||
June 23, 2022 Learn » Re: int | missing | absent | |||
|---|---|---|---|
| |||
...slightly different -- you don't need to serialize anything. The parser provides mechanisms to jump... | |||
June 21, 2022 Learn » Re: int | missing | absent | |||
|---|---|---|---|
| |||
...schveiguy/jsoniopipe/blob/4fa5350ed97786e34612a755f7e857544c6f9512/source/iopipe/json/serialize.d#L50-L55 Or, you can provide... | |||
May 12, 2022 Learn » Re: What are (were) the most difficult parts of D? | |||
|---|---|---|---|
| |||
...code, I would do something like:
auto serialize(T)(T data) {
static if (is(T... | |||
May 03, 2022 Learn » Re: How to get compatible symbol names and runtime typeid names for templated classes? | |||
|---|---|---|---|
| |||
...classes, because you need to declare the serialize methods in the base class without `override... | |||
May 03, 2022 Learn » Re: How to get compatible symbol names and runtime typeid names for templated classes? | |||
|---|---|---|---|
| |||
...nutshell, what Serializable does is to inject serialize() and deserialize() methods into the class hierarchy... | |||
May 03, 2022 Learn » Re: How to get compatible symbol names and runtime typeid names for templated classes? | |||
|---|---|---|---|
| |||
...Child();
// if we called this in the serialize function or even one of those constructors... | |||
March 22, 2022 Learn » Re: Determining function template from runtime type: better ideas? | |||
|---|---|---|---|
| |||
...Base, C), C)) {
override void serialize(...) {
serializeImpl();
}
} else {
void serialize(...) {
serializeImpl();
}
}
private void serializeImpl(...) {
auto... | |||
March 22, 2022 Learn » Determining function template from runtime type: better ideas? | |||
|---|---|---|---|
| |||
...main() {
writeln(serialize(new Person)); // name,age
writeln(serialize(new Boss)); // numEmployees
writeln(serialize(cast... | |||
March 14, 2022 General » Re: Dynamic templated virtuals - I still often want them | |||
|---|---|---|---|
| |||
but this fails:
```d
class Base {
string serialize(this This)() {
string _stringof = This.stringof;
return... | |||
Copyright © 1999-2021 by the D Language Foundation