Hi.
I want to somehow list members of a class in the order of their
declaration. The immediate goal is to generate a few functions,
like the "default" constructor for structs but only with all the
fields, or the "reader" function, but I'm interested in the
general question as well.
I can g
Hi All,
In my adventure to learn a little bit of D coming from C++ I am
now faced with the following problem:
I have read about "cross-module overloading", ยง5.5.2 page 146 of
Andrei Alexandrescu book.
That makes sense to me and this is interesting.
As a concrete example here the scenario: I
The line:
assert(isnan (c.curActivation), "cell has unexpected curActivation:
%s".format(c.curActivation));
throws the exception:
core.exception.AssertError@cell.d(285): cell has unexpected
curActivation: nan
and I've looked at it backwards and forwards and don't understand why.
It's
Hello,
how can I copy class when I have pointer to the parent of it?
eg.
class Foo {
int m_a;
this(const(Foo) other) {
m_a = other.m_a;
}
}
class Bar : Foo {
int m_b;
this(const(Bar) other) {
super(other);
m_b = other.m_b;
}
R dup(this R)(
On Thursday, 10 November 2016 at 16:41:56 UTC, Charles Hixson
wrote:
It's *supposed* to be nan, and the assert message reports that
it is, but it should pass the assert test, not throw an
assertion. What am I doing wrong?
How did you set it? There are like billions of different NaNs.
I'm not
On Thursday, November 10, 2016 15:46:11 Picaud Vincent via Digitalmars-d-
learn wrote:
> ---> What am I missing? What is the right way to do that?
Honestly, I'm surprised that the compiler let you alias
std.algorithm.comparison.min, because it's a templated function, and in the
case of templat
On Thursday, 10 November 2016 at 16:44:24 UTC, Satoshi wrote:
But this implementation of dup doesn't work.
The dup will need to be a virtual function in the base class for
best results, reimplemented in each child class.
You could also copy the bytes using runtime type info...
void*
Hi, what is a correct (and simple) way to create an singleton?
This is how I see that now:
```
class ApMessageRouter
{
static ApMessageRouter instance = null;
private this() { } // for disable constructor to use from
outside
public
On Thursday, 10 November 2016 at 17:17:51 UTC, Konstantin
Kutsevalov wrote:
Hi, what is a correct (and simple) way to create an singleton?
https://wiki.dlang.org/Low-Lock_Singleton_Pattern
On Thursday, 10 November 2016 at 17:22:48 UTC, Anonymouse wrote:
On Thursday, 10 November 2016 at 17:17:51 UTC, Konstantin
Kutsevalov wrote:
Hi, what is a correct (and simple) way to create an singleton?
https://wiki.dlang.org/Low-Lock_Singleton_Pattern
great!
On Thursday, 10 November 2016 at 17:12:32 UTC, Jonathan M Davis
wrote:
On Thursday, November 10, 2016 15:46:11 Picaud Vincent via
Digitalmars-d- learn wrote:
[...]
Honestly, I'm surprised that the compiler let you alias
std.algorithm.comparison.min, because it's a templated
function, and in t
On 11/10/16 12:17 PM, Konstantin Kutsevalov wrote:
Hi, what is a correct (and simple) way to create an singleton?
This is how I see that now:
```
class ApMessageRouter
{
static ApMessageRouter instance = null;
private this() { } // for disable constructor to use from outside
p
On 11/10/16 12:12 PM, Jonathan M Davis via Digitalmars-d-learn wrote:
On Thursday, November 10, 2016 15:46:11 Picaud Vincent via Digitalmars-d-
learn wrote:
---> What am I missing? What is the right way to do that?
Honestly, I'm surprised that the compiler let you alias
std.algorithm.compa
On Thursday, November 10, 2016 14:32:28 Steven Schveighoffer via
Digitalmars-d-learn wrote:
> On 11/10/16 12:12 PM, Jonathan M Davis via Digitalmars-d-learn wrote:
> > On Thursday, November 10, 2016 15:46:11 Picaud Vincent via
> > Digitalmars-d-
> >
> > learn wrote:
> >> ---> What am I missing
On Thursday, November 10, 2016 17:41:02 Picaud Vincent via Digitalmars-d-
learn wrote:
> It is certainly a compiler problem: I used gdc -> compile error,
> but with dmd it compiles and runs fine. Full details in the git
> repo.
Don't bother with gdc at this point. Unless there's a development vers
On Thursday, November 10, 2016 14:25:49 Steven Schveighoffer via
Digitalmars-d-learn wrote:
> There's a specific way to create a singleton that David Simcha outlined
> in a talk at dconf 2013, that avoids all the race condition issues that
> singletons traditionally have:
>
> https://davesdprogram
On Thursday, 10 November 2016 at 20:12:10 UTC, Jonathan M Davis
wrote:
On Thursday, November 10, 2016 17:41:02 Picaud Vincent via
Digitalmars-d- learn wrote:
It is certainly a compiler problem: I used gdc -> compile
error, but with dmd it compiles and runs fine. Full details in
the git repo.
On 11/10/2016 08:47 AM, Adam D. Ruppe via Digitalmars-d-learn wrote:
On Thursday, 10 November 2016 at 16:41:56 UTC, Charles Hixson wrote:
It's *supposed* to be nan, and the assert message reports that it is,
but it should pass the assert test, not throw an assertion. What am
I doing wrong?
H
Dne 10.11.2016 v 17:41 Charles Hixson via Digitalmars-d-learn napsal(a):
The line:
assert(isnan (c.curActivation), "cell has unexpected
curActivation: %s".format(c.curActivation));
throws the exception:
core.exception.AssertError@cell.d(285): cell has unexpected
curActivation: nan
an
19 matches
Mail list logo