Suppose I have an component based game engine, and in that engine I have an
object that stores a repository of properties in a form of a stl map and can
be accessed through the object access() method, which is a templated call so
you can access and store any type of data into the repository, eg:

```
class component {
    private:
        object * parent;

    public:
        component() : parent(0) { }
        void setparent(object * p) { parent = p; }
        virtual void tick() = 0;
}

class object {
    private:
        std::list compipeline;

    public:
        template<typename prop_t>
            access(std::string propname) {
                static std::map<std::string, prop_t> repository;
                return repository;
            }

        void attach(component * c) {
            compipelane.push_back(c);
            c->setparent(this);
        }
};

```

In this schema, components will call something like

`parent.access<double>("health) = 0;`

Thats fine so far but suppose I want to support dynamic loading of components.
I know that templates are resolved in compile time, then all code for access()
calls like the one above will be generated when my engine code is compiled.
But then I develop a component and compile it as a loadable shared library that
does an parent.access("damage"), eg:

```
class health : public component {
    public:
        health(object & parent) : component(parent) { }
        virtual void tick() {
            double damage = parent.access<double>("damage");
            parent.access<double>("health") -= damage;
            parent.access<double>("damage") = 0;
        }
}
```

Well then begins my sea of questions and doubts: Will this code compile as a
shared library? If yes, what will happen when I load it at runtime and plug in
a already created and populated with other components object? Suppose other
components that already made the access<double>(...) call, will the map be
the same?

Suppose the component also had a type created, like struct position { int x,y; }
that was not defined before so this code hasn't been compiled in the main engine,
what will happen in `access<position>(...)` in this recently-plugged component?

Sorry about the big question, but its a big question in my head also.
I am fairly familiar with C++ but still understanding how templates works...

Does anybody have experience with this that could enlighten me?

Also I feel that a static std::map inside a function call is not the best
approach but I cannot think of another that will let me create spans of
different property repositories based on a call...

Thank you!