I have a Base Class with an Inner Class with two pointers to the Inner Class and one Inner Class data member. I next define a Derived Class with two ...
I have a Base Class with an Inner Class with two pointers to the Inner Class and one Inner Class data member. I next define a Derived Class with two ...
I have a method that must run different ways, depending on the type of the object received. But, I dont know how to acces the properties of the object ...
In my project i receive a JSON which represents a Configuration for an device. Each device has one or more Interfaces that it can be connected with. I ...
As I was messing with tasks, I made a private async method that returns a random number after a delay. I had also made a public method that calls the ...
What I'm trying to do is to have a base class that has a primary functionality, as well as multiple derived classes that have various other additional ...
I have this code right here where i tried to cout main outside of the function and one inside the function. However i can only access main inside th ...
I am trying to implement a multi-type container in C++ without using std::any, std::variant, boost::any, etc. The add() function adds new objects (int ...
Following up on this question C++ inheritence and array I have a question about derived classes and their methods. Currently I have this base class ...
Let's say I need to attach some 'type id' to my Eigen::VectorXf vectors. So far I have something like this (simplified for brevity): (Please don't ...
I have seen a lot of times people adding the default constructor of base class in the derived class constructor initializer list like so Derived cl ...
I feel like this is a pretty basic C++ question. I am trying to make a class which contains a member variable which is a shared_ptr to any class which ...
I need to get access of the base class private member variables using public member functions from the derived class. That means, I can call it anytim ...
I define two classes A and B.As seen, their member func is the same, but with different member variable type q and different constructor. So could ...
When I call foo.SetContent(derived), I get the Assert. Is it not possible for the derived class to use the specialization for it's base class? ...
I have an abstract (templated) class that I want to have its own return type InferenceData. Now below is an attempt to derive from it This works ...
I've been trying to apply SOLID principles more consciously on my current project. Using interfaces to create the abstraction and allowing classes tha ...
I have the classes Player and HumanPlayer. HumanPlayer is derived from Player. I want to make a constructor for HumanPlayer the set the Player id a ...
I have a base class ShowTicket with parameterized constructor: I am creating a derived class, SportTicket that will take the same parameters as Sho ...
I want to store a std::vector<> containing objects which have a common base class, within a host class. The host class should remain copiable si ...
I want to have an unordered map with a string and a std::function that call a constructor a class to make a shared_ptr. But I'm stuck, I don't know wh ...