0

I have the following base class:

class OpCode {
public:
    OpCode(const std::shared_ptr<CharacterContext> &characterContext);

    virtual void operator()(std::uint_fast32_t argument) = 0;
protected:
    std::shared_ptr<CharacterContext> character_context;
};

If I declare a class like this:

class xxx : OpCode {
public:
   using OpCode::OpCode;
}

and then do ^I to implement methods and select operator() it creates:

private:
    void operator()(std::uint_fast32_t argument) override {

    }

Why is it making this private? Shouldn't it be public? I'm wondering if there's some underlying C++ idiom that I don't know.

Don Hosek
  • 981
  • 6
  • 23

0 Answers0