Hi Everybody:
so I was making some test with std::vector with codeblocks and the try to test same code on hardware with embitz.
The problem here is in this segment of code:
void World::update()
{
auto e = std::begin(entities);
while (e != std::end(entities))
{
//Update
(*e)->Update();
//Remove if dead
if ((*e)->Life<1)
{
delete(*e);
e = entities.erase(e);
}
else
{
++e;
}
}
}
Where entities is a vector of pointers to a base class GameObj
vector<GameObj*> entities;
Code works as expected in Code::Blokcs iterating trough all the entities and removing them when aged.
In Embtiz it seems like the auto keyword broke the compiler:
Unfortunately mbed online compiler does not support C++11. I think I turned it off at some point, but for working offline I guess it should be enabled by default.
I hope to get chance to, as well as finishing those PEX tutorials (I haven’t completely forgotten them).
The last few months most of my spare time has been preoccupied with another project I’ve been helping with, which was finally released on 2017/12/20 after about 2-3 months of work, and then had a few major updates in the following weeks (even on Christmas day the two programmers, myself and filmote (Simon Holmes), were discussing space-saving updates).
I’ve been having a (somewhat deserved) break since then, focusing more on playing games than writing them, lest my brain start melting.
Out of interest, if I were to write a document/article explaining C++11 features to people familiar with C++03/C++ in general, would there be any interest in that?
(Or were you thinking more of a “C++ with no prior experience, from a C++11 point of view” type of thing?)
I’ve some experience with other languages, as the most of us I suppose (Lua, Basic, Python, C# etc).
Basic tutorial (if-then-else, while, etc) are fine but mostly to point out the difference in using limited resources in embedded system. Otherwise any standard online tutorial is good enough.
I’ve choose Pokitto to learn C/C++ for embedded system. I’ve read some C/C++ tutorials and now I’m looing for the best way to use std library (vector, map etc) and C++11 style (auto etc).
This together a general overview of the API (Modules, Libraries, Graphics, Sound) should give all the tools to develop best app for Pokitto.