I'm trying to build a simple entity/component system in c++ base on the second answer to this question : [Best way to organize entities in a game?](https://stackoverflow.com/questions/764824/best-way-to-organize-entities-in-a-game)

Now, I would like to have a static std::map that returns (and even automatically create, if possible). 

What I am thinking is something along the lines of:

```
PositionComponent *pos = systems[PositionComponent].instances[myEntityID];

```

What would be the best way to achieve that?