C++ Logo

SG10

Advanced search

Subject: Re: [SG10] __has_[cpp_]attribute
From: Ed Smith-Rowland (3dw4rd_at_[hidden])
Date: 2014-06-18 19:43:18


On 06/18/2014 01:09 PM, Nelson, Clark wrote:
> This was discussed in EWG this afternoon.
>
> One of the principal objections to this idea has been the complications
> involved in implementing it with a separate preprocessor. But no one could
> think of any popular C++ implementation that actually uses a separate
> preprocessor. It was also pointed out that we've been making more and more
> changes that mean that a standard preprocessor for C can't be used for C++,
> including raw string literals in C++11 and apostrophe as a digit separator
> in C++14. (And for that matter bool in C++98.) Using a separate preprocessor
> is just getting harder and less likely. It was also pointed out that, if the
> preprocessor is integrated with the parser, a single table of attributes can
> be used for both parsing and feature-testing.
Also user-defined literals would be hell without an integrated preprocessor.
OTOH, I've been looking at g++ and it looks like an almost pure C++ FE
thing... Maybe I'm missing something.
> So it looks like we'll be adding __has_cpp_attribute to our recommendations.
Thanks for the early warning.

Ed


SG10 list run by sg10-owner@lists.isocpp.org