Original Post
Ok, I just started fiddeling some with the smart pointers in boost but I'm unable to figure what pointer is useful for what. I've looked at some of their samples and none really makes me any wiser... as I don't see the meaning of what they do. I tried their shared_ptr example and sure it works, but, I cannot assign elements to the hash_map if it would be out of the local scope (since as soon as the local scope ends, the inserted element will free itself)... How does one usually accomplish this kind of behaviour? That is, common hash_map use, for instance, have a class variable of the type hash_map... and then being able to add elements to it using the functions implemented in my class, without having to do all the tedious cleaning up when removing elements from it. Thanks in advance.