c++ - How to Make a vector of template structs -
possible duplicate:
c++ template problem
hi everyone:
i'm stuck trying following:
template <typename t> struct test { t* value; test(int num_of_elements) { value = new t[num_of_elements] }; } std::vector<test *> fields_; i.e. want make vector of pointers set of test structs different types value?
how do this?
thanks
ross
you use boost::any. example documentation illustrates use case (at least, you've described far):
struct property { property(); property(const std::string &, const boost::any &); std::string name; boost::any value; }; typedef std::list<property> properties;
Comments
Post a Comment