S
S
Sergey2016-02-12 14:52:47
C++ / C#
Sergey, 2016-02-12 14:52:47

Why doesn't std::list.push_back() work?

An object is created, push_back is made to std::list, but when iterating it is not [in std::list].
PS pastebin.com/9ygLzNVR (.hpp), pastebin.com/hV4bPUfH (.cpp)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey, 2016-02-12
@DrMGC

The problem was this:
It should be:

inline const phys::World& world() const { return m_world; }
inline phys::World& world() { return m_world; }

And it was:
inline const phys::World world() const { return m_world; }
inline phys::World world() { return m_world; }

I
iv_k, 2016-02-12
@iv_k

try iterating over the link
for (auto &b : m_bodies)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question