On Fri, May 6, 2016 at 1:56 PM, Pedro Alves <pal...@redhat.com> wrote: > On 05/06/2016 05:40 PM, David Malcolm wrote: >> +#if __cplusplus >= 201103 >> +/* C++11 claims to be available: use it: */ >> +#define OVERRIDE override >> +#define FINAL final >> +#else >> +/* No C++11 support; leave the macros empty: */ >> +#define OVERRIDE >> +#define FINAL >> +#endif >> + > > Is there a reason this is preferred over using override/final in > the sources directly, and then define them away as empty > on pre-C++11? > > I mean: > > #if __cplusplus < 201103 > # define override > # define final > #endif > > then use override/final throughout instead of OVERRIDE/FINAL.
This would break any existing use of those identifiers; they are not keywords, so a variable named "final" is perfectly valid C++11. Jason