Skip to content

Latest commit

 

History

History
85 lines (73 loc) · 1.71 KB

collection-adapter-size-stl-clr.md

File metadata and controls

85 lines (73 loc) · 1.71 KB
title collection_adapter::size (STL/CLR) | Microsoft Docs
ms.custom
ms.date 11/04/2016
ms.reviewer
ms.suite
ms.technology
cpp-windows
ms.tgt_pltfrm
ms.topic reference
f1_keywords
cliext::collection_adapter::size
dev_langs
C++
helpviewer_keywords
size member [STL/CLR]
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.

Syntax

size_type size();  

Remarks

The member function returns the length of the controlled sequence. It is not defined in a specialization for IEnumerable or IEnumerable<Value>.

Example

// 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);   
    }  
  
 x x x x x x  
size() = 6  

Requirements

Header: <cliext/adapter>

Namespace: cliext

See Also

collection_adapter (STL/CLR)