digitalmars.D.learn - how to reflect on function attributes
- Ellery Newcomer (3/3) Jun 04 2013 specifically, const, eg.
- Jonathan M Davis (3/8) Jun 04 2013 is(typeof(A.func) == const)
- Ellery Newcomer (2/10) Jun 04 2013 I think that is for type only. It returns false for me.
- Jonathan M Davis (5/18) Jun 04 2013 What do you mean for type only? const is part of the type. What else wou...
- Ellery Newcomer (2/20) Jun 04 2013 Ah, you're right. don't know how I screwed that up.
- Ellery Newcomer (1/2) Jun 04 2013 Yes I do. I was trying to use typeof(&A.func)
- lomereiter (3/5) Jun 04 2013 This doesn't work when the method is marked as @property. Any
- Jonathan M Davis (7/14) Jun 05 2013 I don't know. My first guess would be that it thought that it was callin...
- Ellery Newcomer (2/16) Jun 05 2013 pragma(msg, is(FunctionTypeOf!(A.func) == const));
- =?UTF-8?B?QWxpIMOHZWhyZWxp?= (5/8) Jun 04 2013 Not that it adds more information over the spec, but I have finished the...
specifically, const, eg. class A { void func() const { blah } } std.traits.FunctionAttributes makes no mention of it
Jun 04 2013
On Tuesday, June 04, 2013 19:03:47 Ellery Newcomer wrote:specifically, const, eg. class A { void func() const { blah } } std.traits.FunctionAttributes makes no mention of itis(typeof(A.func) == const) - Jonathan M Davis
Jun 04 2013
On 06/04/2013 07:19 PM, Jonathan M Davis wrote:On Tuesday, June 04, 2013 19:03:47 Ellery Newcomer wrote:I think that is for type only. It returns false for me.specifically, const, eg. class A { void func() const { blah } } std.traits.FunctionAttributes makes no mention of itis(typeof(A.func) == const) - Jonathan M Davis
Jun 04 2013
On Tuesday, June 04, 2013 19:23:45 Ellery Newcomer wrote:On 06/04/2013 07:19 PM, Jonathan M Davis wrote:What do you mean for type only? const is part of the type. What else would it be part of? For the code example that you gave (minus the blah in the middle), it returns true. - Jonathan M DavisOn Tuesday, June 04, 2013 19:03:47 Ellery Newcomer wrote:I think that is for type only. It returns false for me.specifically, const, eg. class A { void func() const { blah } } std.traits.FunctionAttributes makes no mention of itis(typeof(A.func) == const) - Jonathan M Davis
Jun 04 2013
On 06/04/2013 07:43 PM, Jonathan M Davis wrote:On Tuesday, June 04, 2013 19:23:45 Ellery Newcomer wrote:Ah, you're right. don't know how I screwed that up.On 06/04/2013 07:19 PM, Jonathan M Davis wrote:What do you mean for type only? const is part of the type. What else would it be part of? For the code example that you gave (minus the blah in the middle), it returns true. - Jonathan M DavisOn Tuesday, June 04, 2013 19:03:47 Ellery Newcomer wrote:I think that is for type only. It returns false for me.specifically, const, eg. class A { void func() const { blah } } std.traits.FunctionAttributes makes no mention of itis(typeof(A.func) == const) - Jonathan M Davis
Jun 04 2013
Ah, you're right. don't know how I screwed that up.Yes I do. I was trying to use typeof(&A.func)
Jun 04 2013
This doesn't work when the method is marked as property. Any idea why is that so? On Wednesday, 5 June 2013 at 02:19:38 UTC, Jonathan M Davis wrote:is(typeof(A.func) == const) - Jonathan M Davis
Jun 04 2013
On Wednesday, June 05, 2013 08:52:35 lomereiter wrote:This doesn't work when the method is marked as property. Any idea why is that so? On Wednesday, 5 June 2013 at 02:19:38 UTC, Jonathan M Davis wrote:I don't know. My first guess would be that it thought that it was calling it except that it's being referenced by the type, not by an instance, so that doesn't really make sense. - Jonathan M Davis P.S. Please don't top-post. It makes it harder to follow posts and is generally considered bad newsgroup etiquette.is(typeof(A.func) == const) - Jonathan M Davis
Jun 05 2013
On 06/05/2013 12:02 AM, Jonathan M Davis wrote:On Wednesday, June 05, 2013 08:52:35 lomereiter wrote:pragma(msg, is(FunctionTypeOf!(A.func) == const));This doesn't work when the method is marked as property. Any idea why is that so? On Wednesday, 5 June 2013 at 02:19:38 UTC, Jonathan M Davis wrote:I don't know. My first guess would be that it thought that it was calling it except that it's being referenced by the type, not by an instance, so that doesn't really make sense. - Jonathan M Davis P.S. Please don't top-post. It makes it harder to follow posts and is generally considered bad newsgroup etiquette.is(typeof(A.func) == const) - Jonathan M Davis
Jun 05 2013
On 06/04/2013 07:03 PM, Ellery Newcomer wrote:specifically, const, eg. class A { void func() const { blah } } std.traits.FunctionAttributes makes no mention of itNot that it adds more information over the spec, but I have finished the translation of the "is Expression" chapter just yesterday: http://ddili.org/ders/d.en/is_expr.html Ali
Jun 04 2013