August 03, 2020 Learn » Re: Question about UDAs | |||
|---|---|---|---|
| |||
...structs and classes that I want to serialize, and instead of writing tons and tons... | |||
July 29, 2020 General » Re: Dynamic templated virtuals - I still often want them | |||
|---|---|---|---|
| |||
...now and it works):
```
class Base {
string serialize() {
alias This = Base;
return This.stringof; // just... | |||
July 23, 2020 General » Re: Dynamic templated virtuals - I still often want them | |||
|---|---|---|---|
| |||
...example
};
}
final string serialize() {
return _serialize(this);
}
private string function(Base) _serialize;
}
class Derived: Base... | |||
July 23, 2020 General » Re: Dynamic templated virtuals - I still often want them | |||
|---|---|---|---|
| |||
...module foo;
import std;
class Base {
string serialize() {
return typeid(this).toString; // just for example... | |||
July 23, 2020 General » Re: Dynamic templated virtuals - I still often want them | |||
|---|---|---|---|
| |||
...need the `virtual` keyword:
```
class Base {
string serialize(this This)() {
return This.stringof; // just for... | |||
July 23, 2020 General » Dynamic templated virtuals - I still often want them | |||
|---|---|---|---|
| |||
...class Base {
string serialize() {
return Base.stringof;
}
}
class Derived : Base {
override string serialize() {
return Derived... | |||
July 21, 2020 Learn » Re: Accurately serializing and deserializing a SysTime in binary format | |||
|---|---|---|---|
| |||
...my mistake was to try to directly serialize a SysTime as provided by the "getTimes... | |||
July 21, 2020 Learn » Re: Accurately serializing and deserializing a SysTime in binary format | |||
|---|---|---|---|
| |||
...serialize the stdTime [1], and set the time zone to whatever you want: long serialize... | |||
July 21, 2020 Learn » Re: Accurately serializing and deserializing a SysTime in binary format | |||
|---|---|---|---|
| |||
Ah, sorry, I serialize exactly long value and use it as SysTime, for example: ```D... | |||
July 21, 2020 Learn » Re: Accurately serializing and deserializing a SysTime in binary format | |||
|---|---|---|---|
| |||
That is probably a bug. I serialize SysTime as long by means msgpack for exchanging... | |||
Copyright © 1999-2021 by the D Language Foundation