ONE - On-device Neural Engine
Loading...
Searching...
No Matches
vector.h File Reference

This file contains == operator to check equality of elements in two vectors. More...

#include <vector>

Go to the source code of this file.

Functions

template<typename T >
bool operator== (const std::vector< T > &lhs, const std::vector< T > &rhs)
 Compare elements of two vectors.
 

Detailed Description

This file contains == operator to check equality of elements in two vectors.

Definition in file vector.h.

Function Documentation

◆ operator==()

template<typename T >
bool operator== ( const std::vector< T > &  lhs,
const std::vector< T > &  rhs 
)

Compare elements of two vectors.

Template Parameters
TType of elements in vectors
Parameters
[in]lhsFirst vector to compare
[in]rhsSecond vector to compare
Returns
true if all elements are equal, otherwise false.

Definition at line 34 of file vector.h.

35{
36 if (lhs.size() != rhs.size())
37 {
38 return false;
39 }
40
41 for (size_t ind = 0; ind < lhs.size(); ++ind)
42 {
43 if (lhs.at(ind) != rhs.at(ind))
44 {
45 return false;
46 }
47 }
48
49 return true;
50}