Skip to content

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

Description

@panikgit

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
    }
};

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions