CORBA::Any a;
CORBA::Octet o;
CORBA::Long l;
a <<= CORBA::Long(1); // a contains 1 with CORBA::Long type
if (a >>= l) {
cout << "Long: " << l << endl;
} else {
cout << "Unknown value." << endl;
}
a <<= CORBA::Any::from_octet(65); // a contains 64 with CORBA::Octet type
if (a >>= CORBA::Any::to_octet(o)) {
延伸阅读
文章来源于领测软件测试网 https://www.ltesting.net/