EN VI
Posts (0)
Questions (4)
2024-03-12 08:30:04
Despite its name, the shared_variable you're creating in Parent.__init__ is not in fact being shared between anything. It's initialized uniquely for each instance of any of your classes. You can see t...
Tags: python inheritance
2024-03-12 16:30:04
You may want to look into the CRTP pattern for this, if I understand your intent correctly. Also, your outline has no way to properly free dynamic memory, you better derive BaseV from a common interfa...
Tags: c++ templates inheritance
2024-03-13 11:30:04
If you define a function in a derived class it completely hides any function in the base class with the same name in the derived class's namespace. That means that the add member function in your Lexe...
Tags: c++ inheritance struct
2024-03-16 02:30:05
You can pass a copy to Base then store the original in p_ Derived(std::shared_ptr p) : Base({p}), p_(std::move(p)) { }

Login


Forgot Your Password?

Create Account


Lost your password? Please enter your email address. You will receive a link to create a new password.

Reset Password

Back to login