// Truncate to three elements
myseq.length(3); // Deallocates "fourth"
// Grow to five elements (add two empty strings)
myseq.length(5);
// Initialize appended elements
myseq[3] = CORBA::string_dup("4th");
myseq[4] = CORBA::string_dup("5th");
// Print contents once more
for (CORBA::ULong k = 0; k < myseq.length(); k++)
cout << "myseq[" << k << "] = \"" << myseq[k].in() << "\"" << endl;
return 0;
}
· union
idl中的union类型与C++中的union不是等价的,它实际上被映射成了对应的class,同时在使用上与C++中的union也有极大区别。以下面的idl为例:
文章来源于领测软件测试网 https://www.ltesting.net/