This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Macro for C++14 support
- From: Paolo Carlini <paolo dot carlini at oracle dot com>
- To: Gabriel Dos Reis <gdr at integrable-solutions dot net>, Jonathan Wakely <jwakely dot gcc at gmail dot com>
- Cc: "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Date: Tue, 23 Apr 2013 16:44:02 +0200
- Subject: Re: Macro for C++14 support
- References: <CAH6eHdRC=1+VFUDFrt7kjFTy9QkTNB9tQB95-AUNMyKOyKkM+A at mail dot gmail dot com> <CAAiZkiBQxNS33H0uEgZfRTY0kBEgyc7+hCzeXw-V+KGiEka1mQ at mail dot gmail dot com> <007d1aea-9f40-4324-9db2-3c1d4fd3ccb7 at email dot android dot com>
Hi again,
Paolo Carlini <paolo.carlini@oracle.com> ha scritto:
>Hi,
>
>Gabriel Dos Reis <gdr@integrable-solutions.net> ha scritto:
>
>>There appear to be two targets: C++14 and C++17. Personally, I am
>>inclined
>>to have CXX14 and CXX1Y, where CXX1Y is for the presumed C++17 target.
>
>This clarified - thanks - I'm wondering if it's safe to assume that the
>C++14 library is a superset of the C++11 one: in that case passing
>-std=c++14 would also automatically define the C++11 macro
Well, on second thought, I think we could do this anyway and be done in the wast majority of cases. Then, in special cases, where say the same facility is different in the two standards, we can always check both macros. I see now the issue mostly as a documentation issue: we would have to explain the users that -std=c++14 defines the C++11 macro too. This is *not* the same as -std=c++11 vs -std=c++98. If it's a problem, back to the huge search&replace ;)
Paolo