Ary Borenszweig Wrote:
> FQN = Fully Qualified Name
Got it.Thanks!
> If you always want DMD never to bounds check for specific code, you just
> can write "a.ptr[index]" instead of "a[index]" (when a is an array).
> That's because array.ptr returns a pointer to the first element, and
> using [] on a pointer works exactly like C pointer math. The good thing
> ab
>> Or does the compiler handle them like any
>> other
>> function and just thinks of a name itself ?
>
> Exactly. If you compile with DMD and the -v flag you can see what names it
> gives them.
:) nice
Thanks!
Hello Saaa,
Hello Saaa,
How should I do this then?
C c;
C2 c2 = new C2;
C3 c3 = new C3;
c=c2;
auto dg = { return c.method(); };
c=c3;
I actually did it like this before :) Thanks
But like this I need to do the "c is null" checking within the
function
literal.
I'm not sure how these functi
> Hello Saaa,
>
>> How should I do this then?
>
> C c;
> C2 c2 = new C2;
> C3 c3 = new C3;
> c=c2;
>
> auto dg = { return c.method(); };
>
> c=c3;
I actually did it like this before :) Thanks
But like this I need to do the "c is null" checking within the function
literal.
I'm not sure how these
#ponce wrote:
Stewart Gordon Wrote:
My recollection of reading the spec is that a D compiler is allowed to
optimise by assuming no pointer aliasing. But I can't remember at the
moment where I read this.
I don't know if this is neat or nasty for a compiler to do so.
OT : Is there a DMD swi
Hello Saaa,
How should I do this then?
C c;
C2 c2 = new C2;
C3 c3 = new C3;
c=c2;
auto dg = { return c.method(); };
c=c3;
Hello Saaa,
"Daniel Keep" wrote in message
news:h88i4n$235...@digitalmars.com...
Saaa wrote:
"Daniel Keep" wrote in message
news:h88cck$1or...@digitalmars.com...
Saaa wrote:
abstract class C
{
int method();
}
class C2:C
{
int method() return 2;
}
class C3:C
{
int method() return 3;
}
i
>
> class Foo
> {
> C* c;
>
> this(ref C c)
> {
>this.c = &c;
> }
>
> int invoke()
> {
>return (*c).method();
> }
> }
>
> void main()
> {
> // ...
> deleg = &(new Foo(c)).invoke;
> }
>
> Or something similar.
>
> This is dangerous. Do not allow either the Foo instance or the deleg
Saaa wrote:
> Ok, disregard my last comment :D
> How should I do this then?
class Foo
{
C* c;
this(ref C c)
{
this.c = &c;
}
int invoke()
{
return (*c).method();
}
}
void main()
{
// ...
deleg = &(new Foo(c)).invoke;
}
Or something similar.
This is dangerous. Do n
"Daniel Keep" wrote in message
news:h88i4n$235...@digitalmars.com...
>
>
> Saaa wrote:
>> "Daniel Keep" wrote in message
>> news:h88cck$1or...@digitalmars.com...
>>>
>>> Saaa wrote:
abstract class C
{
int method();
}
class C2:C
{
int method() return 2;
"Ary Borenszweig" wrote in message
news:h88i6o$23h...@digitalmars.com...
> Saaa wrote:
>> "Daniel Keep" wrote in message
>> news:h88cck$1or...@digitalmars.com...
>>>
>>> Saaa wrote:
abstract class C
{
int method();
}
class C2:C
{
int method() return 2;
Saaa wrote:
"Daniel Keep" wrote in message
news:h88cck$1or...@digitalmars.com...
Saaa wrote:
abstract class C
{
int method();
}
class C2:C
{
int method() return 2;
}
class C3:C
{
int method() return 3;
}
int delegate() deleg;
void main()
{
C c;
C2 c2 = new C2;
C3 c3 = new C3;
c=c2;
c
Saaa wrote:
> "Daniel Keep" wrote in message
> news:h88cck$1or...@digitalmars.com...
>>
>> Saaa wrote:
>>> abstract class C
>>> {
>>> int method();
>>> }
>>> class C2:C
>>> {
>>> int method() return 2;
>>> }
>>> class C3:C
>>> {
>>> int method() return 3;
>>> }
>>> int delegate() deleg;
>>>
"Daniel Keep" wrote in message
news:h88cck$1or...@digitalmars.com...
>
>
> Saaa wrote:
>> abstract class C
>> {
>> int method();
>> }
>> class C2:C
>> {
>> int method() return 2;
>> }
>> class C3:C
>> {
>> int method() return 3;
>> }
>> int delegate() deleg;
>> void main()
>> {
>> C c;
>> C
Saaa wrote:
> abstract class C
> {
> int method();
> }
> class C2:C
> {
> int method() return 2;
> }
> class C3:C
> {
> int method() return 3;
> }
> int delegate() deleg;
> void main()
> {
> C c;
> C2 c2 = new C2;
> C3 c3 = new C3;
> c=c2;
> deleg = &c.method;
> writefln(deleg()); // 2
>
abstract class C
{
int method();
}
class C2:C
{
int method() return 2;
}
class C3:C
{
int method() return 3;
}
int delegate() deleg;
void main()
{
C c;
C2 c2 = new C2;
C3 c3 = new C3;
c=c2;
deleg = &c.method;
writefln(deleg()); // 2
c=c3;
writefln(deleg()); // 2
// I expected this to wr
Sam Hu escribió:
div0 Wrote:
You must have two different HANDLEs around.
The one in phobos is aliased to void* and there is no LoadLibraryEx call
in phobos, so you must be using something else.
Try using the FQN of the import where you are getting the LoadLibraryEx
from.
Thanks for your help.
18 matches
Mail list logo