Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion: In the CRTP example, make impl method private in the derived class #81

Open
panikgit opened this issue Aug 15, 2022 · 0 comments

Comments

@panikgit
Copy link

Method do_something_impl is private in the base class and public in the derived class foo.

class foo : public base<foo>
{
public:
void do_something_impl()
{
// Derived implementation
}
};

For consistency, make do_something_impl private.

class foo : public base<foo>
{
  friend class base<foo>;
  private:
    void do_something_impl()
    {
      // Derived implementation
    }
};
@panikgit panikgit changed the title Suggestion: In CRTP example, make impl method private in the derived class Suggestion: In the CRTP example, make impl method private in the derived class Aug 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant