My brain just exploded.
Can someone explain what's going on?
class Test
{
public void foo() { }
}
static assert(is(typeof(&Test.foo) == void function()));
On 18-05-2012 20:22, Mehrdad wrote:
My brain just exploded.
Can someone explain what's going on?
class Test
{
public void foo() { }
}
static assert(is(typeof(&Test.foo) == void function()));
Delegates. Pointer to member function + class instance.
--
Alex Rønne Petersen
a...@lycus.org
http://
On 5/18/12 1:22 PM, Mehrdad wrote:
My brain just exploded.
Can someone explain what's going on?
class Test
{
public void foo() { }
}
static assert(is(typeof(&Test.foo) == void function()));
Looks like a bug. The assert should pass only if foo were static.
Andrei
On Friday, 18 May 2012 at 18:30:48 UTC, Andrei Alexandrescu wrote:
On 5/18/12 1:22 PM, Mehrdad wrote:
My brain just exploded.
Can someone explain what's going on?
class Test
{
public void foo() { }
}
static assert(is(typeof(&Test.foo) == void function()));
Looks like a bug. The assert should
On Friday, 18 May 2012 at 18:32:00 UTC, Mehrdad wrote:
Okay I'll report it... hopefully it isn't just with my version
though (a little different from official version).
http://d.puremagic.com/issues/show_bug.cgi?id=8114
On Fri, 18 May 2012 14:30:46 -0400, Andrei Alexandrescu
wrote:
On 5/18/12 1:22 PM, Mehrdad wrote:
My brain just exploded.
Can someone explain what's going on?
class Test
{
public void foo() { }
}
static assert(is(typeof(&Test.foo) == void function()));
Looks like a bug. The assert should
On Friday, 18 May 2012 at 18:59:23 UTC, Steven Schveighoffer
wrote:
On Fri, 18 May 2012 14:30:46 -0400, Andrei Alexandrescu
wrote:
On 5/18/12 1:22 PM, Mehrdad wrote:
My brain just exploded.
Can someone explain what's going on?
class Test
{
public void foo() { }
}
static assert(is(typeof(&T
On Fri, 18 May 2012 15:17:28 -0400, Mehrdad wrote:
On Friday, 18 May 2012 at 18:59:23 UTC, Steven Schveighoffer wrote:
On Fri, 18 May 2012 14:30:46 -0400, Andrei Alexandrescu
wrote:
On 5/18/12 1:22 PM, Mehrdad wrote:
My brain just exploded.
Can someone explain what's going on?
class Tes
On 18-05-2012 21:34, Steven Schveighoffer wrote:
On Fri, 18 May 2012 15:17:28 -0400, Mehrdad wrote:
On Friday, 18 May 2012 at 18:59:23 UTC, Steven Schveighoffer wrote:
On Fri, 18 May 2012 14:30:46 -0400, Andrei Alexandrescu
wrote:
On 5/18/12 1:22 PM, Mehrdad wrote:
My brain just exploded.
On 5/18/12 1:59 PM, Steven Schveighoffer wrote:
On Fri, 18 May 2012 14:30:46 -0400, Andrei Alexandrescu
wrote:
On 5/18/12 1:22 PM, Mehrdad wrote:
My brain just exploded.
Can someone explain what's going on?
class Test
{
public void foo() { }
}
static assert(is(typeof(&Test.foo) == void func
"Mehrdad" wrote in message
news:ifswigmcenyryxzyv...@forum.dlang.org...
> On Friday, 18 May 2012 at 18:59:23 UTC, Steven Schveighoffer wrote:
>> On Fri, 18 May 2012 14:30:46 -0400, Andrei Alexandrescu
>> wrote:
>>
>>> On 5/18/12 1:22 PM, Mehrdad wrote:
My brain just exploded.
Can some
On Saturday, 19 May 2012 at 01:37:54 UTC, Daniel Murphy wrote:
No, that won't work in all cases due to the ordering of
parameters, 'this' and the hidden struct pointer.
Better than not working in /any/ cases lol. :P
Maybe you can add a void* for the hidden struct parameter? idk...
"Mehrdad" wrote in message
news:sxiwbwuwvcjrlvpfs...@forum.dlang.org...
> On Saturday, 19 May 2012 at 01:37:54 UTC, Daniel Murphy wrote:
>> No, that won't work in all cases due to the ordering of parameters,
>> 'this' and the hidden struct pointer.
>
> Better than not working in /any/ cases lol.
On Saturday, 19 May 2012 at 02:38:11 UTC, Daniel Murphy wrote:
I'd actually rather it /didn't/ work in any cases, and just
returned void*.
Well if that's an option then I like that too.
Le 19/05/2012 03:37, Daniel Murphy a écrit :
"Mehrdad" wrote in message
news:ifswigmcenyryxzyv...@forum.dlang.org...
On Friday, 18 May 2012 at 18:59:23 UTC, Steven Schveighoffer wrote:
On Fri, 18 May 2012 14:30:46 -0400, Andrei Alexandrescu
wrote:
On 5/18/12 1:22 PM, Mehrdad wrote:
My bra
Le 18/05/2012 22:35, Andrei Alexandrescu a écrit :
On 5/18/12 1:59 PM, Steven Schveighoffer wrote:
On Fri, 18 May 2012 14:30:46 -0400, Andrei Alexandrescu
wrote:
On 5/18/12 1:22 PM, Mehrdad wrote:
My brain just exploded.
Can someone explain what's going on?
class Test
{
public void foo() {
On Fri, 18 May 2012 16:35:38 -0400, Andrei Alexandrescu
wrote:
On 5/18/12 1:59 PM, Steven Schveighoffer wrote:
On Fri, 18 May 2012 14:30:46 -0400, Andrei Alexandrescu
wrote:
On 5/18/12 1:22 PM, Mehrdad wrote:
My brain just exploded.
Can someone explain what's going on?
class Test
{
publ
On 2012-05-22 20:14, Steven Schveighoffer wrote:
I agree, it's unsound. But so is this:
int *blah = void;
*blah = 5;
It doesn't mean that the language should forbid it, or that the compiler
isn't implemented as designed.
At the *very least*, the address to member function operation should be
On Tue, 22 May 2012 14:28:33 -0400, Jacob Carlborg wrote:
On 2012-05-22 20:14, Steven Schveighoffer wrote:
I would suggest that it should be:
function(Test this) with the 'this' being mangled into the name, and
affect the calling convention.
Structs would be function(ref Test this).
And co
On 2012-05-22 20:35, Steven Schveighoffer wrote:
It needs to be possible to compose delegates:
class Foo
{
void foo () {};
}
void delegate () dg;
dg.funcptr = &Foo.foo;
Error, cannot cast function of type void function(Foo this) to void
function(void *this)
dg.funcptr = cast(void function(
On 5/22/12 1:14 PM, Steven Schveighoffer wrote:
I agree, it's unsound. But so is this:
int *blah = void;
*blah = 5;
It doesn't mean that the language should forbid it, or that the compiler
isn't implemented as designed.
Initialization with void is a feature. My example shows the fail of a
f
On 5/22/12 4:05 PM, Steven Schveighoffer wrote:
On Tue, 22 May 2012 15:29:10 -0400, Andrei Alexandrescu
wrote:
On 5/22/12 1:14 PM, Steven Schveighoffer wrote:
I agree, it's unsound. But so is this:
int *blah = void;
*blah = 5;
It doesn't mean that the language should forbid it, or that the
On Tue, 22 May 2012 15:29:10 -0400, Andrei Alexandrescu
wrote:
On 5/22/12 1:14 PM, Steven Schveighoffer wrote:
I agree, it's unsound. But so is this:
int *blah = void;
*blah = 5;
It doesn't mean that the language should forbid it, or that the compiler
isn't implemented as designed.
Init
23 matches
Mail list logo