I'm posting this in Learn because I'm assuming I've done
something wrong rather than discovered a bug.
Running `dmd -main main.d` with the following 3 files produces
the following linker error.
```
$ dmd -main main.d
Undefined symbols for architecture x86_64:
"_D13linking_fails12__ModuleInf
On Thursday, 1 December 2016 at 07:13:45 UTC, Bauss wrote:
On Thursday, 1 December 2016 at 00:36:30 UTC, Jake Pittis wrote:
[...]
You could do something like below which will allow you to
serialize any number.
import std.stdio : writeln;
import std.traits : isNumeric;
ubyte[] bytes(T)
How do I convert a double to a ubyte[]?
I've tried all sorts of things including converting the double to
a ulong and trying to serialize the ulong. For example test
bellow fails.
unittest {
double d = 3.14;
ulong l = *cast(ulong*)(&d);
double after = *cast(double*)(&l));
import std.stdio;
import std.array;
import std.algorithm;
import std.range;
InputRange!string keys(int[string] foo) {
return foo.byPair.map!(p => p[0]);
}
void main() {
int[string] foo;
foo["lol"] = 1;
foo["wat?"] = 2;
keys(foo).each!(p => writeln(p));
}
The above code produ