On Friday, 15 December 2017 at 21:56:48 UTC, Steven Schveighoffer
wrote:
On 12/15/17 10:08 AM, Kagamin wrote:
Maybe this https://issues.dlang.org/show_bug.cgi?id=18084
Thanks for looking into this. I created a PR to fix.
Szabo, can you please try with this patch and see if it fixes
your issu
Thanks for the insights everyone, it really helped!
I actually discovered that it wasn't working because one of the
parsing functions used `std.range.take` and, since I was giving
it a slice, `take` decided to save the fwdrange instead of
mutating it. I realised the `take` call was 100% useles
Hello,
I'm writing a small parser for a specific binary format. The
format is parsed by way of a sequence of functions, each
deserializing a small portion of the format into a D type such as
int, double, string, etc., operating on a single InputRange. The
problem is, if I pass a slice to each
On Thursday, 6 July 2017 at 16:16:17 UTC, H. S. Teoh wrote:
Which version of the compiler are you using? I just tested on
the latest dmd git HEAD, and it (correctly) tells me that it's
illegal to override a non-virtual function. I'm surprised you
got your code to compile at all.
`dmd --vers
On Thursday, 6 July 2017 at 06:48:57 UTC, rikki cattermole wrote:
Templates+classes = require function body.
Why? Templated methods are not virtual, they are final and
cannot be inherited (so its a little strange that the override
is valid).
Ah well. I would've expected a compiler error, not
Hello. I am trying to compile this:
---
module asd.asd;
abstract class Asd
{
void opCall(Args...)(Args args);
}
@system unittest
{
class Foo : Asd
{
override void opCall(Args...)(Args args)
{
/* nothing */
}
}
Asd a = new Foo();
a(1,
On Sunday, 25 June 2017 at 02:09:53 UTC, Adam D. Ruppe wrote:
On Sunday, 25 June 2017 at 02:05:35 UTC, unleashy wrote:
How would I call `addToBar` from C code?
You don't. Instead write it like:
struct Foo
{
int bar;
}
extern(C) void addToBar(Foo* foo, int what) {
foo.bar += what;
Hello! If I have a D struct like:
struct Foo
{
int bar;
void addToBar(int what) {
bar += what;
}
}
How would I call `addToBar` from C code? Would I need to put the
`addToBar` function outside of the struct and mark it as `extern
(C)` and in normal D code take advantage of