KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I'd like to construct a message with unknown length or number of arguments. I took a simple template like template <typename T> class Argument { public: int size; int type; T data; }; and with some overloaded addMessage (int value) { Argument<int> *a = new Argument<int>; vec.push_back(a); } (same for string and so on) I try to push it all into one vector. I tried std::vector<Argument* > vec; std::vector<Argument<typename T>* > vec; std::vector<Argument<>* > vec; but nothing of this seems to work. Is there a way to do this? Thanks in advance.
Tags (comma-separated)
Save Edits
Cancel