On Thu, 28 Jan 2021 at 10:15, Ville Voutilainen <[email protected]> wrote:
> On Thu, 28 Jan 2021 at 12:13, Jonathan Wakely via SG10 > <[email protected]> wrote: > > > > > > > > On Wed, 27 Jan 2021 at 20:54, Barry Revzin via Liaison < > [email protected]> wrote: > >> > >> Eric Niebler actually asked this on StackOverflow a few years ago: > https://stackoverflow.com/q/48045470/2069064 > >> > >> The accepted answer there is: > >> > >> #define PP_THIRD_ARG(a,b,c,...) c > >> #define VA_OPT_SUPPORTED_I(...) PP_THIRD_ARG(__VA_OPT__(,),true,false,) > >> #define VA_OPT_SUPPORTED VA_OPT_SUPPORTED_I(?) > > > > > > Who is going to remember that without having to look it up though? > > Is it going to be written so often that that becomes a major problem? > > > The #ifdef __VA_OPT__ solution was my first thought, it's unfortunate we > forbid it. If we can't have that then I think we do need a feature test > macro. The voodoo above will make most developers wish they were using Rust. > > If they're using VA_OPT, the cause is already lost. > And even if we add a feature test macro now (or allow #ifdef __VA_OPT__) there are still compilers that will reject it with an error (e.g. with -pedantic-errors in pre-C++20 modes). So maybe the ship has sailed and support this feature is already "untestable". You just have to know if your code can use it or not.
-- SG10 mailing list [email protected] https://lists.isocpp.org/mailman/listinfo.cgi/sg10
