Subject: Re: [SG10] __has_[cpp_]attribute
From: Stephen Kelly (steveire_at_[hidden])
Date: 2014-06-09 17:39:57
Nelson, Clark wrote:
>> > Would it be fair to restate your questions as, why are we
>> > something like __has_attribute when we didn't recommend
> I was actually hoping someone would provide an answer to that question.
Can we ask the person who proposed it?
> I myself am opposed -- weakly -- to the __has_attribute syntax, or some
> variation thereof, for all the reasons we didn't go with __has_feature in
> the first place, as I explained a couple of weeks ago.
I favor consistency between the feature test and the attribute test.
I weakly favor __has_foo() for these reasons:
1) For creating the consistency (at least from the users point of view) of
all such tests now and in the future being __has_foo().
For example, __has_builtin(is_final) might solve the problem here:
2) For making it harder for users to make mistakes such as
when they meant
#if __cpp_foo > 201404
#if __cpp_foo >= 201404
I think __cpp_foo is fine because it might be easier to implement. However,
I would request consistent prefixes/namespacing to allow for growth in the
classes of tests recommended (eg builtins):
SG10 list run by firstname.lastname@example.org