Thread overview | |||||||||
---|---|---|---|---|---|---|---|---|---|
|
February 10, 2013 Missing attributes in FunctionAttribute | ||||
---|---|---|---|---|
| ||||
Before I open a new bug report, I would like to ask if anyone knows why FunctionAttribute neither has const, immutable, shared or inout? Especially const and immutable were important to know. |
February 10, 2013 Re: Missing attributes in FunctionAttribute | ||||
---|---|---|---|---|
| ||||
Posted in reply to Namespace | 2/10/13, Namespace <rswhite4@googlemail.com> wrote: > Before I open a new bug report It's in bugzilla: http://d.puremagic.com/issues/show_bug.cgi?id=8812 |
February 10, 2013 Re: Missing attributes in FunctionAttribute | ||||
---|---|---|---|---|
| ||||
Posted in reply to Namespace | On Sunday, 10 February 2013 at 12:29:46 UTC, Namespace wrote: > Before I open a new bug report, I would like to ask if anyone knows why FunctionAttribute neither has const, immutable, shared or inout? > Especially const and immutable were important to know. Well, technically, those are not function attributes but generic type qualifiers. You can always do something like is(func == const). You may check recently pulled update to fullyQualifiedName (should be in next release) to see how it works for function types. Not obvious part probably is delegate handling. https://github.com/D-Programming-Language/phobos/pull/863 |
February 10, 2013 Re: Missing attributes in FunctionAttribute | ||||
---|---|---|---|---|
| ||||
Posted in reply to Dicebot | On 2/10/13, Dicebot <m.strashun@gmail.com> wrote:
> On Sunday, 10 February 2013 at 12:29:46 UTC, Namespace wrote:
>> Before I open a new bug report, I would like to ask if anyone
>> knows why FunctionAttribute neither has const, immutable,
>> shared or inout?
>> Especially const and immutable were important to know.
>
> Well, technically, those are not function attributes but generic type qualifiers.
In the spec they're listed as member function attributes.
|
February 10, 2013 Re: Missing attributes in FunctionAttribute | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrej Mitrovic | On Sunday, 10 February 2013 at 18:25:25 UTC, Andrej Mitrovic wrote:
> On 2/10/13, Dicebot <m.strashun@gmail.com> wrote:
>> On Sunday, 10 February 2013 at 12:29:46 UTC, Namespace wrote:
>>> Before I open a new bug report, I would like to ask if anyone
>>> knows why FunctionAttribute neither has const, immutable,
>>> shared or inout?
>>> Especially const and immutable were important to know.
>>
>> Well, technically, those are not function attributes but generic
>> type qualifiers.
>
> In the spec they're listed as member function attributes.
Which part? Probably it refers to delegates, because it has both type qualifiers and attribute that qualifies hidden context pointer.
|
February 10, 2013 Re: Missing attributes in FunctionAttribute | ||||
---|---|---|---|---|
| ||||
Posted in reply to Dicebot | On 2/10/13, Dicebot <m.strashun@gmail.com> wrote: > Which part? Probably it refers to delegates, because it has both type qualifiers and attribute that qualifies hidden context pointer. Could be. Anyway it's here: http://dlang.org/declaration.html#MemberFunctionAttributes |
February 10, 2013 Re: Missing attributes in FunctionAttribute | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrej Mitrovic | On Sunday, 10 February 2013 at 19:51:36 UTC, Andrej Mitrovic wrote: > On 2/10/13, Dicebot <m.strashun@gmail.com> wrote: >> Which part? Probably it refers to delegates, because it has both >> type qualifiers and attribute that qualifies hidden context >> pointer. > > Could be. Anyway it's here: > > http://dlang.org/declaration.html#MemberFunctionAttributes Ye, notice the word "member" and difference with http://dlang.org/declaration.html#FunctionAttributes ; It is for delegates (implicit or explicit) and qualifies context pointer / this, not type itself. Probably functionAttributes template could have handled this special case but I have no idea if it should. |
Copyright © 1999-2021 by the D Language Foundation