C++ Logo

std-proposals

Advanced search

Re: [std-proposals] requires keyword (new use)

From: William Linkmeyer <wlink10_at_[hidden]>
Date: Sun, 1 May 2022 11:27:10 -0400
This is not a proposal, this is a question.

The message could have been “how can I make classes default to sane values without writing to std-proposals about introducing new keywords?”

WL

> On May 1, 2022, at 4:15 AM, Abdullah Qasim via Std-Proposals <std-proposals_at_[hidden]> wrote:
>
> 
>
> int menu (/**/requires/**/ unsigned int menu_option = 0)
>
> // Called as:
> menu(default);
>
> // OR:
> menu(5)
>
> // Compiler Error: function "menu(unsigned int)" requires //unsigned int variable
> menu()
>
> I do not want calls like menu(), but I do want ability to call menu(default), as, in this case, going to default screen makes perfect sense.
>
> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals

Received on 2022-05-01 15:27:12