I am getting some weird behaviour with range-based for loop in C++11 with Urho3D containers. It looks like undefined behaviour as sometimes I am getting a crash and sometimes I am not. I hope I am not doing it completely wrong. As far as I remember this should work with STL containers and smart pointers.
This is a simple example:
- Code: Select all
particleEmitter1_ = particleNode_->CreateComponent<ParticleEmitter>();
particleEmitter2_ = particleNode_->CreateComponent<ParticleEmitter>();
for (auto particleEmitter : particleEmitters_)