Date: Fri, 30 May 2014 14:49:09 +0200
Nelson, Clark wrote:
> Technically, at the moment we are exploring __has_cpp_attribute as a
> direction. It hasn't yet been approved by WG21.
Ok
>
> The rationale for not recommending __has_feature is hinted at in the
> document:
>
> [3] Fortunately Clang has ways to test specifically for the presence of
> specific features. But unfortunately, the function-call-like syntax used
> for such tests won't work with a standard preprocessor, so this fine new
> feature winds up adding its own flavor of complexity to the mix.
Thanks for pointing that out. Unfortunately I do not know what does or does
not make a 'standard preprocessor', so I don't understand. What is the
difference, in that sense, between __has_include and __has_feature?
> To put it more bluntly, SG10's purpose is to make it possible for a
> program to detect what new features are present in an implementation. If
> we had made a recommendation that depended entirely on the existence of
> yet another new feature, we would have built a castle in the air.
I don't understand this either I'm afraid :(.
Are you suggesting that something similar to the __has_include example in
the document can not work or is fundamentally undesirable?
#ifdef __has_feature
# if __has_feature(cpp_variadic_templates)
# define BOOST_HAVE_VARIADIC_TEMPLATES
# endif
#endif
Thanks,
Steve.
> Technically, at the moment we are exploring __has_cpp_attribute as a
> direction. It hasn't yet been approved by WG21.
Ok
>
> The rationale for not recommending __has_feature is hinted at in the
> document:
>
> [3] Fortunately Clang has ways to test specifically for the presence of
> specific features. But unfortunately, the function-call-like syntax used
> for such tests won't work with a standard preprocessor, so this fine new
> feature winds up adding its own flavor of complexity to the mix.
Thanks for pointing that out. Unfortunately I do not know what does or does
not make a 'standard preprocessor', so I don't understand. What is the
difference, in that sense, between __has_include and __has_feature?
> To put it more bluntly, SG10's purpose is to make it possible for a
> program to detect what new features are present in an implementation. If
> we had made a recommendation that depended entirely on the existence of
> yet another new feature, we would have built a castle in the air.
I don't understand this either I'm afraid :(.
Are you suggesting that something similar to the __has_include example in
the document can not work or is fundamentally undesirable?
#ifdef __has_feature
# if __has_feature(cpp_variadic_templates)
# define BOOST_HAVE_VARIADIC_TEMPLATES
# endif
#endif
Thanks,
Steve.
Received on 2014-05-30 14:49:19