operator== <array>

동일한 배열 비교 합니다.

template<Ty, std::size_t N>
    bool operator==(
        const array<Ty, N>& left,
        const array<Ty, N>& right);

매개 변수

  • Ty
    요소의 형식입니다.

  • N
    배열의 크기입니다.

  • left
    비교할 왼쪽된 컨테이너입니다.

  • right
    비교할 오른쪽 컨테이너입니다.

설명

함수 템플릿의 오버 로드 operator== 템플릿 클래스의 두 개체를 비교 하려면 array Class (TR1).The function returns equal(left.begin(), left.end(), right.begin()).

예제

 

// std_tr1__array__operator_eq.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 = {4, 5, 6, 7}; 
 
// display contents " 4 5 6 7" 
    for (Myarray::const_iterator it = c1.begin(); 
        it != c1.end(); ++it) 
        std::cout << " " << *it; 
    std::cout << std::endl; 
 
// display results of comparisons 
    std::cout << std::boolalpha << " " << (c0 == c0); 
    std::cout << std::endl; 
    std::cout << std::boolalpha << " " << (c0 == c1); 
    std::cout << std::endl; 
 
    return (0); 
    } 
 
  

요구 사항

헤더: <array>

네임 스페이스: std

참고 항목

참조

array::begin

array::end

<array>

operator!= <array>

operator>= <array>

operator> <array>

operator< <array>

operator<= <array>