C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Real World Programming, private = public

From: Frederick Virchanza Gotham <cauldwell.thomas_at_[hidden]>
Date: Sat, 2 Sep 2023 15:02:27 +0100
On Sat, Sep 2, 2023 at 2:49 PM Phil Endecott via Std-Proposals
<std-proposals_at_[hidden]> wrote:
>
> Frederick Virchanza Gotham wrote:
> > #define private public
> > #define protected public
>
> gcc has -fno-access-control. I have used that for cases where I want
> to inspect normally-private members for debugging.
>
> I don't know what that does re the SFINAE issue that you mention.


If you want to forbid move-construction of your class, then they right
way to do it is:

        MyClass(MyClass&&) = delete;

But I think there's still plenty of code out there with:

    private:
        MyClass(MyClass&&);

so that's another thing to watch out for.

Received on 2023-09-02 14:02:39