Using std::shared_ptr<void> to point to anything
问题 I'm using a std::shared_ptr<void> in my application to make a smart pointer which can point to many different types of data structures like structs, vectors, matrices... basically anything. What I'm trying to do is map some names to their data structures. I'm performing the mapping using a hashtable: std::unordered_map<std::string, std::shared_ptr<void>> Can I cast the std::shared_ptr<void> returned by find() back to std::shared_ptr<my_type> ? If so, how? More importantly, is this good