Skip to content

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

@panikgit

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

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