64,654
社区成员
发帖
与我相关
我的任务
分享
int main()
{
std::vector<boost::any> some_value;
some_value.push_back(10);
const char* szStr = "Holle Word!";
some_value.push_back(szStr);
some_value.push_back(std::string("Wow!"));
std::string& s = boost::any_cast<std::string&>(some_value.back());
s += " This is great!";
std::cout << boost::any_cast<std::string&>(some_value.back()).c_str() << std::endl;
std::cout << s.c_str() << std::endl;
some_value.push_back(1.1f);
std::for_each(some_value.begin(), some_value.end(), doType());
return 0;
}