I want to do something like this, but I’m not sure if it is possible. I can’t find any information on Google.
template <typename T>
class Container {
public:
T *ptr;
};
class Other {
private:
Container *container_ref;
}
Thanks for the help.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It’s not, but if you are in charge of
Containerthen you can make it inherit from a non-templated base class and keep a pointer to that.