C++ Logo

std-proposals

Advanced search

Re: [std-proposals] [Resurrected Proposal] Concept introduces a typename

From: Frederick Virchanza Gotham <cauldwell.thomas_at_[hidden]>
Date: Tue, 2 May 2023 14:04:26 +0100
On Tue, May 2, 2023 at 12:32 PM Andrew Tomazos via Std-Proposals
<std-proposals_at_[hidden]> wrote:
>
> For what it's worth, I'm strongly in favor of the underlying motivation of this proposal.
>
> You should be able to write:
>
> void sort(Sortable& x);
>
> as was originally intended when concepts were designed.


I have only one concern about that:

void Func(Sortable &x)
{
    static once_flag of;

    call_once(of, [](){ cout << "I hope this only happens once\n"; });
}

It isn't obvious at first glance that the 'call_once' could happen
more than once.

Received on 2023-05-02 13:04:34