collection_adapter::size (STL/CLR)
計數項目的數目。
size_type size();
備註
成員函式會傳回受控制序列的長度。 未定義的特製化中IEnumerable或IEnumerable<Value>。
範例
// cliext_collection_adapter_size.cpp
// compile with: /clr
#include <cliext/adapter>
#include <cliext/deque>
typedef cliext::collection_adapter<
System::Collections::ICollection> Mycoll;
int main()
{
cliext::deque<wchar_t> d6x(6, L'x');
Mycoll c1(%d6x);
// display initial contents " x x x x x x"
for each (wchar_t elem in c1)
System::Console::Write(" {0}", elem);
System::Console::WriteLine();
System::Console::WriteLine("size() = {0}", c1.size());
return (0);
}
需求
標頭: < cliext/介面卡 >
Namespace: cliext