#4643 closed Bugs (invalid)
Does array operator== behave as excpected
| Reported by: | Owned by: | No-Maintainer | |
|---|---|---|---|
| Milestone: | To Be Determined | Component: | array |
| Version: | Boost 1.44.0 | Severity: | Problem |
| Keywords: | Cc: |
Description
this is the body of method operator==:
return std::equal(x.begin(), x.end(), y.begin());
If x is of size n doesn't this just compare if y's first n elements are equal to n. What if y is bigger than x? Is this really the expected behavior?
Change History (2)
comment:1 by , 12 years ago
| Resolution: | → invalid |
|---|---|
| Status: | new → closed |
comment:2 by , 12 years ago
Note:
See TracTickets
for help on using tickets.

Just adding a comment here (in case someone is wondering down the road): The operator == compares two arrays of the same size.
template<class T, std::size_t N> bool operator== (const array<T,N>& x, const array<T,N>& y) { return std::equal(x.begin(), x.end(), y.begin()); }