std.traits: provide short alias for FunctionAttributes#4274
std.traits: provide short alias for FunctionAttributes#4274wilzbach wants to merge 1 commit intodlang:masterfrom
Conversation
I think we should add it, but maybe taking strings instead: |
|
LGTM |
Agreed |
|
Okay will send hasFunctionAttributes after dconf ;-) |
|
I disagree with adding the name. A local alias or |
|
Also, as a general thing, the alias would need to be documented (at least using |
|
Yeah I'm against this too, it just introduces a poorly named global name and will likely cause the dmd spellchecker to often suggest using this symbol. |
|
Not very popular idea;) going to close it |
It's quite common to abbreviate
FunctionAttributewithFA- this just makes it official.As you can see even all the tests use it.
The enum is only used for
functionAttributes, e.g.functionAttributes!func & FA.pure_which already explains the name.Note: it doesn't try to change the existing name nor deprecate it.
General question: why don't we provide the abstraction
hasFunctionAttributes!(func,FA.pure_)? It just seems to me that's what the user wants anyways and bitwise OR-ing seems not really like a Phobos-style.edit: you even already provide
isSafeandisUnsafe...