RobotExample2 - smucs/Cpp11-Experimentation GitHub Wiki

Robot Example 2

Changed the shared_ptr to a vector of shared_ptr (as in stl::vector) and exposing the iterators. Seems to involve a large amount of de-referencing and brackets, may need checking.

Rational

Original motivation for this was due to issues with my Growing Neural Gas Network, which uses a similar array of shared_ptrs with iterators.

Issues

In both cases issues surrounding the copy constructor and move constructor which are the most complex as they require access to copy the private variables.

Can copy/move constructors access the private members of a sibling? --> Answer turned out to be yes.

Still need to resolve how the const copy constructor is called, reading around online there is a suggestion that copy constructors should take a const but when I tried this it seems the non-const version is called.

⚠️ **GitHub.com Fallback** ⚠️