how to reflect on function attributes

Ellery Newcomer ellery-newcomer at utulsa.edu
Tue Jun 4 19:50:53 PDT 2013


On 06/04/2013 07:43 PM, Jonathan M Davis wrote:
> On Tuesday, June 04, 2013 19:23:45 Ellery Newcomer wrote:
>> On 06/04/2013 07:19 PM, Jonathan M Davis wrote:
>>> 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 it
>>>
>>> is(typeof(A.func) == const)
>>>
>>> - Jonathan M Davis
>>
>> I think that is for type only. It returns false for me.
>
> 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 Davis
>

Ah, you're right. don't know how I screwed that up.


More information about the Digitalmars-d-learn mailing list