Skip to main content

All Questions

0 votes
1 answer
116 views

C++ class design with shared pointers methods [closed]

I dont exactly know, how to handle the problem, where one class uses shared pointers but I want to call its method from inside other class via this pointer. class Bar { public: Bar() = default; ~...
Martin Perry's user avatar
12 votes
4 answers
22k views

Using vectors of shared pointers to objects in my C++ code to prevent object duplication

In my C++ project, I have three classes, Particle, Contact, and Network. The Network class will have N particles (std::vector<Particle> particles) and Nc contacts (std::vector<Contact> ...
AnInquiringMind's user avatar