다음을 통해 공유


array::operator=

제어 되는 시퀀스를 대체합니다.

array <Value>% operator=(array <Value>% right);

매개 변수

  • right
    컨테이너에 복사 합니다.

설명

각 요소의 멤버 연산자 지정 right 제어 되는 시퀀스의 해당 요소에 다음 반환 *this.제어 되는 시퀀스에서 제어 되는 시퀀스의 복사본으로 바꾸려면 사용 right.

예제

 

// std_tr1__array__array_operator_as.cpp 
// compile with: /EHsc 
#include <array> 
#include <iostream> 
 
typedef std::array<int, 4> Myarray; 
int main() 
    { 
    Myarray c0 = {0, 1, 2, 3}; 
 
// display contents " 0 1 2 3" 
    for (Myarray::const_iterator it = c0.begin(); 
        it != c0.end(); ++it) 
        std::cout << " " << *it; 
    std::cout << std::endl; 
 
    Myarray c1; 
    c1 = c0; 
 
// display copied contents " 0 1 2 3" 
    for (Myarray::const_iterator it = c1.begin(); 
        it != c1.end(); ++it) 
        std::cout << " " << *it; 
    std::cout << std::endl; 
 
    return (0); 
    } 
 
  

요구 사항

헤더: <array>

네임 스페이스: std

참고 항목

참조

<array>

array Class (TR1)

array::assign