title
collection_adapter::size (STL/CLR) | Microsoft Docs
ms.custom
ms.date
11/04/2016
ms.reviewer
ms.suite
ms.technology
ms.tgt_pltfrm
ms.topic
reference
f1_keywords
cliext::collection_adapter::size
dev_langs
helpviewer_keywords
ms.assetid
71866719-9e29-4572-bfb9-60321f2937c5
caps.latest.revision
9
author
mikeblome
ms.author
mblome
manager
ghogen
translation.priority.ht
cs-cz
de-de
es-es
fr-fr
it-it
ja-jp
ko-kr
pl-pl
pt-br
ru-ru
tr-tr
zh-cn
zh-tw
collection_adapter::size (STL/CLR)
Counts the number of elements.
Remarks
The member function returns the length of the controlled sequence. It is not defined in a specialization for IEnumerable or 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);
}
Header: <cliext/adapter>
Namespace: cliext
collection_adapter (STL/CLR)