void func(T : int)(T value) if (is(T == int)) {
}
struct S {
int x;
alias x this;
}
void main() {
func(S()); // error
}
In above code, 'func' can accept only int as its argument type,
so when 'S', which can be implicitly convertible into int, is
passed on 'func', I expect S.x is
On Monday, 15 October 2018 at 03:33:04 UTC, Basile B. wrote:
On Monday, 15 October 2018 at 03:19:07 UTC, IM wrote:
I probably used to know the answer to this question, but it's
been a long time since I last used D, and I don't remember.
Suppose we have:
struct S {
int num;
}
Would
On Monday, 15 October 2018 at 03:19:07 UTC, IM wrote:
I probably used to know the answer to this question, but it's
been a long time since I last used D, and I don't remember.
Suppose we have:
struct S {
int num;
}
Would allocating an instance on the heap using:
S* s = new S;
use the GC,
I probably used to know the answer to this question, but it's
been a long time since I last used D, and I don't remember.
Suppose we have:
struct S {
int num;
}
Would allocating an instance on the heap using:
S* s = new S;
use the GC, or do we have to call destroy() or delete on s
On Sunday, 14 October 2018 at 15:06:49 UTC, Basile B. wrote:
The basic problem you're faced to here is that D class /
interface member functions that are templatized are never
virtual. I'm not sure if i understand well the JAVA pattern you
try to reproduce but since D interfaces can be
On Monday, 8 October 2018 at 09:39:55 UTC, John Burton wrote:
I would do much better to maintain a fixed size buffer and
maintain read and write positions etc.
Perhaps
https://github.com/AuburnSounds/Dplug/blob/master/core/dplug/core/ringbuf.d#L16
On Sunday, 14 October 2018 at 13:21:00 UTC, Heromyth wrote:
Here is a sample code
```d
import std.stdio;
class Future(T)
{
T result;
this(T r) {
this.result = r;
}
}
interface IExecutorService {
// Future!(T) submit(T)(T result); // can't be
Here is a sample code
```d
import std.stdio;
class Future(T)
{
T result;
this(T r) {
this.result = r;
}
}
interface IExecutorService {
// Future!(T) submit(T)(T result); // can't be implemented
}
abstract class ExecutorService :
On Monday, 8 October 2018 at 09:39:55 UTC, John Burton wrote:
My use case is sending data to a socket.
We have ported some containers from JAVA.
ByteBuffer is a basic container interface and widely used in JAVA.
See also:
On Sunday, 14 October 2018 at 01:31:26 UTC, Jonathan M Davis
wrote:
Unless there's something about the implementation that's tied
to the list itself, I would think that it would make more sense
to make it a generic algorithm, then it will work with any
non-random-access range, and it avoids
On Sunday, 14 October 2018 at 03:26:33 UTC, Adam D. Ruppe wrote:
On Sunday, 14 October 2018 at 03:07:59 UTC, Chris Katko wrote:
For comparison, I just tested and grep uses about 4 MB of RAM
to run.
Running and compiling are two entirely different things.
Running the D regex code should be
On Sunday, 14 October 2018 at 01:31:26 UTC, Jonathan M Davis
wrote:
Unless there's something about the implementation that's tied
to the list itself, I would think that it would make more sense
to make it a generic algorithm, then it will work with any
non-random-access range, and it avoids
12 matches
Mail list logo