On 2019-04-14 20:01:27 +, diniz said:
Le 14/04/2019 à 20:03, Robert M. Münch via Digitalmars-d-learn a écrit :
struct IM;
struct C {
IM *impl;
};
int cInit(C* self);
class I {
C handler;
this(){cInit(&handler);}
}
Is there a simple way that I can use handler without the address
On 04/14/2019 10:06 PM, LeqxLeqx wrote:
Hello!
I have a question regarding attempting to access the super class of a
derived class at compile time.
BaseClassesTuple and friends:
https://dlang.org/phobos/std_traits.html
Ali
Hello!
I have a question regarding attempting to access the super class
of a derived class at compile time.
Specifically, if I have:
class A { }
class B : A { }
void func(T)()
{
/+ find super-class of T +/
}
int main ()
{
func!B; /+ func would find A
On Sunday, 14 April 2019 at 19:46:41 UTC, Ron Tarrant wrote:
On Monday, 8 April 2019 at 19:54:28 UTC, WhatMeWorry wrote:
[...]
Just so you know who I am and what my experience is:
I've only been using D for a few months and so far, I've only
dabbled in dub. I used to write a blog for PHP-GTK
Le 14/04/2019 à 20:03, Robert M. Münch via Digitalmars-d-learn a écrit :
struct IM;
struct C {
IM *impl;
};
int cInit(C* self);
class I {
C handler;
this(){cInit(&handler);}
}
Is there a simple way that I can use handler without the address-of operator and
automatically get *impl
On Monday, 8 April 2019 at 19:54:28 UTC, WhatMeWorry wrote:
I've been trying to troubleshoot a DUB issue for two days now
and I've come to the conclusion, I don't really understand DUB
and I'm tired of muddling through.
Just so you know who I am and what my experience is:
I've only been using
struct IM;
struct C {
IM *impl;
};
int cInit(C* self);
class I {
C handler;
this(){cInit(&handler);}
}
Is there a simple way that I can use handler without the address-of
operator and automatically get *impl?
Something like:
class I {
C handler;
this(){cIn
On Sunday, 14 April 2019 at 17:33:51 UTC, Adam D. Ruppe wrote:
That will expand to:
I'm sorry, I skipped a step here. The compiler doesn't look into
the mixin string until after it calls mixin, so technically it
goes:
static foreach ->
mixin("void print" ~ 'A' ~ "(int a) {
writeln(
On Sunday, 14 April 2019 at 15:13:37 UTC, Johannes Loher wrote:
At first I was very confused that this example even worked. Why
does `ch` get expanded in the call to writeln? It is part of
the mixed in string, so why does the string not simply include
"writeln(ch, ...)" on every iteration?
T
Am 14.04.19 um 15:22 schrieb Adam D. Ruppe:
> [...]
> Though, I'd point out the mixin code doesn't have to be too ugly.
> Consider this:
>
> void main()
> {
> enum letters = ['A', 'B', 'C'];
>
> static foreach(ch; letters)
> {
> mixin(q{
> void print}~ch~q{(int i) {
>
On Sunday, 14 April 2019 at 12:00:38 UTC, Andrey wrote:
I want to mixin only name - not the full function code.
You can't. Best you can do is write the function separately and
then mixin an alias for it with the other name.
void main()
{
enum letters = ['A', 'B', 'C'];
// normal imp
On Sunday, 14 April 2019 at 12:00:38 UTC, Andrey wrote:
On Sunday, 14 April 2019 at 11:44:16 UTC, Boris Carvajal wrote:
On Sunday, 14 April 2019 at 10:07:30 UTC, Andrey wrote:
I want to mixin only name - not the full function code.
I think you can't do a partial statement in a mixin.
But this
On Sunday, 14 April 2019 at 11:44:16 UTC, Boris Carvajal wrote:
On Sunday, 14 April 2019 at 10:07:30 UTC, Andrey wrote:
Create some function in loop and use it. But I don't know how
to mixin names?
import std.stdio;
void main()
{
enum letters = ['A', 'B', 'C'];
static foreach(ch; le
On Sunday, 14 April 2019 at 10:07:30 UTC, Andrey wrote:
Create some function in loop and use it. But I don't know how
to mixin names?
import std.stdio;
void main()
{
enum letters = ['A', 'B', 'C'];
static foreach(ch; letters)
{
mixin("void print" ~ ch ~ "(uint i) { writ
Hi,
I want to do something like this:
void main()
{
enum letters = ['A', 'B', 'C'];
static foreach(ch; letter)
{
void mixin("print" ~ ch)(uint i)
{
writeln(ch, " - ", i);
}
}
printB(6);
}
Create some function in loop and use it. But
On Saturday, 13 April 2019 at 12:42:36 UTC, Ron Tarrant wrote:
On Saturday, 13 April 2019 at 09:49:47 UTC, number wrote:
On Saturday, 13 April 2019 at 00:25:21 UTC, Ron Tarrant wrote:
I'm asking because ... the messagebox sized itself to the
shorter text in the content area. They said it's an O
16 matches
Mail list logo