list::list (STL/CLR)

컨테이너 개체를 만듭니다.

    list();
    list(list<Value>% right);
    list(list<Value>^ right);
    explicit list(size_type count);
    list(size_type count, value_type val);
    template<typename InIt>
        list(InIt first, InIt last);
    list(System::Collections::Generic::IEnumerable<Value>^ right);

매개 변수

  • count
    삽입할 요소 수입니다.

  • 첫 번째
    삽입할 범위의 시작 부분입니다.

  • last
    삽입 범위 끝입니다.

  • right
    개체 또는 셀 범위를 삽입 합니다.

  • val 함수
    삽입할 요소의 값입니다.

설명

생성자:

list();

제어 되는 시퀀스 요소를 초기화합니다.가 빈 초기 제어 된 시퀀스를 지정할 수 있습니다.

생성자:

list(list<Value>% right);

initializes the controlled sequence with the sequence [right.list::begin (STL/CLR)(), right.list::end (STL/CLR)()).목록 개체에 의해 제어 되는 시퀀스의 복사본은 초기 제어 되는 시퀀스를 지정 하려면 사용 right.

생성자:

list(list<Value>^ right);

initializes the controlled sequence with the sequence [right->list::begin (STL/CLR)(), right->list::end (STL/CLR)()).사용할 핸들 목록 개체에서 제어 시퀀스의 복사본은 초기 제어 되는 시퀀스를 지정 합니다. right.

생성자:

explicit list(size_type count);

제어 되는 시퀀스를 초기화 count 각 요소 값을 가진 value_type().컨테이너 요소를 채우기 위해 순위가 모두 기본값을 사용 하 여.

생성자:

list(size_type count, value_type val);

제어 되는 시퀀스를 초기화 count 각 요소 값을 가진 val.컨테이너 요소를 채우기 위해 순위가 모두 같은 값을 사용 하 여.

생성자:

template<typename InIt>

list(InIt first, InIt last);

제어 되는 시퀀스의 시퀀스를 초기화 [first, last).제어 되는 시퀀스를 다른 시퀀스의 복사본을 사용 합니다.

생성자:

list(System::Collections::Generic::IEnumerable<Value>^ right);

제어 되는 시퀀스 된 열거자에서 지정 시퀀스가 초기화 right.제어 되는 시퀀스를 열거형에서 설명 하는 다른 시퀀스의 복사본을 사용 합니다.

예제

// cliext_list_construct.cpp 
// compile with: /clr 
#include <cliext/list> 
 
int main() 
    { 
// construct an empty container 
    cliext::list<wchar_t> c1; 
    System::Console::WriteLine("size() = {0}", c1.size()); 
 
// construct with a repetition of default values 
    cliext::list<wchar_t> c2(3); 
    for each (wchar_t elem in c2) 
        System::Console::Write(" {0}", (int)elem); 
    System::Console::WriteLine(); 
 
// construct with a repetition of values 
    cliext::list<wchar_t> c3(6, L'x'); 
    for each (wchar_t elem in c3) 
        System::Console::Write(" {0}", elem); 
    System::Console::WriteLine(); 
 
// construct with an iterator range 
    cliext::list<wchar_t>::iterator it = c3.end(); 
    cliext::list<wchar_t> c4(c3.begin(), --it); 
    for each (wchar_t elem in c4) 
        System::Console::Write(" {0}", elem); 
    System::Console::WriteLine(); 
 
// construct with an enumeration 
    cliext::list<wchar_t> c5(   // NOTE: cast is not needed 
        (System::Collections::Generic::IEnumerable<wchar_t>^)%c3); 
    for each (wchar_t elem in c5) 
        System::Console::Write(" {0}", elem); 
    System::Console::WriteLine(); 
 
// construct by copying another container 
    cliext::list<wchar_t> c7(c3); 
    for each (wchar_t elem in c7) 
        System::Console::Write(" {0}", elem); 
    System::Console::WriteLine(); 
 
// construct by copying a container handle 
    cliext::list<wchar_t> c8(%c3); 
    for each (wchar_t elem in c8) 
        System::Console::Write(" {0}", elem); 
    System::Console::WriteLine(); 
 
    return (0); 
    } 
 
  

요구 사항

헤더: < cliext/목록 >

네임 스페이스: cliext

참고 항목

참조

list (STL/CLR)

list::assign (STL/CLR)

list::generic_container (STL/CLR)

list::operator= (STL/CLR)