Date: Fri, 27 Nov 2026 23:39:41 +0100
Hi Simon,
> Date: 2026-11-27 15:42:46+0100
> From: Simon Schröder <dr.simon.schroeder_at_[hidden]>
>
> On Fri, Nov 27, 2026 at 3:02 PM Alejandro Colomar <
> une+cxx_std-proposals_at_[hidden]> wrote:
>
> > Hi David, Simon,
> >
> > > Date: 2026-11-27 14:31:45+0100
> > > From: David Brown via Std-Proposals <std-proposals_at_[hidden]>
> > >
> > >
> > >
> > > On 27/11/2026 14:12, Simon Schröder wrote:
> > > >
> > > > On Fri, Nov 27, 2026 at 1:57 PM David Brown via Std-Proposals <std-
> > > > proposals_at_[hidden] <mailto:std-proposals_at_[hidden]>>
> > > > wrote:
> > > >
> > > >
> > > > For C, you could just have
> > > >
> > > > #define default
> > > >
> > > > and then include the "default" for clarity and portability. That would
> > > > not force the use of "default", but it would at least allow it.
> > > >
> > > >
> > > > C still has 'switch'. So, you shouldn't be doing that...
> > >
> > > Good point!
> >
> > Does C++ not have 'switch'? I see 8.5.3 "The switch statement" in
> > n5054.
> >
> Yes, it does. The suggestion was that we reuse the 'default' keyword for
> default parameters *only* in C++.
If C++ used 'default', I'd propose 'default' for standardization in C.
> '#define default' was just suggested
> *only* for C, so that it would be eliminated for cross C/C++ function
> declarations. This means that the #define does not apply to C++ code. (And
> therefore, regular switch in C++ would be fine because we wouldn't define
> away 'default'.)
Have a lovely night!
Alex
> Date: 2026-11-27 15:42:46+0100
> From: Simon Schröder <dr.simon.schroeder_at_[hidden]>
>
> On Fri, Nov 27, 2026 at 3:02 PM Alejandro Colomar <
> une+cxx_std-proposals_at_[hidden]> wrote:
>
> > Hi David, Simon,
> >
> > > Date: 2026-11-27 14:31:45+0100
> > > From: David Brown via Std-Proposals <std-proposals_at_[hidden]>
> > >
> > >
> > >
> > > On 27/11/2026 14:12, Simon Schröder wrote:
> > > >
> > > > On Fri, Nov 27, 2026 at 1:57 PM David Brown via Std-Proposals <std-
> > > > proposals_at_[hidden] <mailto:std-proposals_at_[hidden]>>
> > > > wrote:
> > > >
> > > >
> > > > For C, you could just have
> > > >
> > > > #define default
> > > >
> > > > and then include the "default" for clarity and portability. That would
> > > > not force the use of "default", but it would at least allow it.
> > > >
> > > >
> > > > C still has 'switch'. So, you shouldn't be doing that...
> > >
> > > Good point!
> >
> > Does C++ not have 'switch'? I see 8.5.3 "The switch statement" in
> > n5054.
> >
> Yes, it does. The suggestion was that we reuse the 'default' keyword for
> default parameters *only* in C++.
If C++ used 'default', I'd propose 'default' for standardization in C.
> '#define default' was just suggested
> *only* for C, so that it would be eliminated for cross C/C++ function
> declarations. This means that the #define does not apply to C++ code. (And
> therefore, regular switch in C++ would be fine because we wouldn't define
> away 'default'.)
Have a lovely night!
Alex
-- <https://www.alejandro-colomar.es>
Received on 2026-11-27 22:39:51
