make_collection (STL/CLR)

확인은 range_adapter 는 반복기 쌍입니다.

template<typename Iter>
    range_adapter<Iter> make_collection(Iter first, Iter last);

매개 변수

  • 반복 계산
    형식 래핑된 반복기입니다.

  • 첫 번째
    배치 하는 첫 번째 반복기입니다.

  • last
    배치 하는 두 번째 반복기입니다.

설명

The template function returns gcnew range_adapter<Iter>(first, last).만드는 데 사용 된 range_adapter<Iter> 에서 한 쌍의 반복기 개체.

예제

// cliext_make_collection.cpp 
// compile with: /clr 
#include <cliext/adapter> 
#include <cliext/deque> 
 
typedef cliext::deque<wchar_t> Mycont; 
typedef cliext::range_adapter<Mycont::iterator> Myrange; 
int main() 
    { 
    cliext::deque<wchar_t> d1; 
    d1.push_back(L'a'); 
    d1.push_back(L'b'); 
    d1.push_back(L'c'); 
 
// display contents " a b c" 
    for each (wchar_t elem in d1) 
        System::Console::Write(" {0}", elem); 
    System::Console::WriteLine(); 
 
    System::Collections::ICollection^ p1 = 
        cliext::make_collection(d1.begin(), d1.end()); 
    System::Console::WriteLine("Count = {0}", p1->Count); 
    System::Console::WriteLine("IsSynchronized = {0}", 
        p1->IsSynchronized); 
    System::Console::WriteLine("SyncRoot not nullptr = {0}", 
        p1->SyncRoot != nullptr); 
 
// copy the sequence 
    cli::array<System::Object^>^ a1 = gcnew cli::array<System::Object^>(5); 
 
    a1[0] = L'|'; 
    p1->CopyTo(a1, 1); 
    a1[4] = L'|'; 
    for each (wchar_t elem in a1) 
        System::Console::Write(" {0}", elem); 
    System::Console::WriteLine(); 
 
    return (0); 
    } 
 
  

요구 사항

헤더: < cliext/어댑터 >

네임 스페이스: cliext

참고 항목

참조

range_adapter (STL/CLR)