C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Copy-construct, move-construct, and PR-construct

From: Frederick Virchanza Gotham <cauldwell.thomas_at_[hidden]>
Date: Sun, 10 Sep 2023 14:20:37 +0100
On Sat, Sep 9, 2023 at 10:45 PM Frederick Virchanza Gotham wrote:
>
> So if we were to have a class defined as follows:
>
> class Monkey {
> operator mutex(void) priority
> {
> // return a mutex from in here
> }
> };


If we were to instead mark the class, for example:

     class Monkey >> mutex {
         operator mutex(void)
         {
             // return a mutex from in here
         }
     };

Then we could stipulate that any forward declarations of the class
must also have the marking, as follows:

    class Monkey; // ill-formed

    class Monkey >> mutex; // well-formed

Here are a few alternative syntaxes:

    class Monkey -> mutex;
    class Monkey : priority(mutex);
    class Monkey : operator(mutex);
    class Monkey |> mutex;

Looking at that last one, if 'Monkey' were to inherit from 'Ape' and
'Apinoid', then the syntax could be:

    class Monkey : public Ape, public Apinoid |> mutex;

Received on 2023-09-10 13:20:50