I would like to get the underlying type of a variant. For example"something similar to this:
typedef boost::variant< shared_ptr<int> , shared_ptr<float> > VType;
typedef VType::get<0>::type TYPE1; // TYPE1 = shared_ptr<int>
TYPE1 value = new std::remove_pointer<TYPE1>::type() // make a new shared_ptr<int>
Any ideas how to achieve this with boost?
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.