mirror of
https://github.com/microsoft/GSL.git
synced 2024-11-03 17:56:43 -05:00
We should be using standard algorithms where possible.
Use of algorithms in the STL should be promoted where possible. Also fixed up some whitespace issues.
This commit is contained in:
parent
b40d3466c6
commit
c4f9b87d96
@ -28,6 +28,7 @@
|
||||
#include <utility>
|
||||
#include <array>
|
||||
#include <iterator>
|
||||
#include <algorithm>
|
||||
#include "fail_fast.h"
|
||||
|
||||
#ifndef _MSC_VER
|
||||
@ -142,12 +143,7 @@ namespace details
|
||||
}
|
||||
_CONSTEXPR bool operator==(const ConcreteType& rhs) const _NOEXCEPT
|
||||
{
|
||||
for (unsigned int i = 0; i < rank; ++i)
|
||||
{
|
||||
if (elems[i] != rhs.elems[i])
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
return std::equal(elems, elems + rank, rhs.elems);
|
||||
}
|
||||
_CONSTEXPR bool operator!=(const ConcreteType& rhs) const _NOEXCEPT
|
||||
{
|
||||
@ -160,8 +156,7 @@ namespace details
|
||||
_CONSTEXPR ConcreteType operator-() const
|
||||
{
|
||||
ConcreteType ret = to_concrete();
|
||||
for (unsigned int i = 0; i < rank; ++i)
|
||||
ret.elems[i] = -ret.elems[i];
|
||||
std::transform(ret, ret + rank, ret, std::negate<ValueType>{});
|
||||
return ret;
|
||||
}
|
||||
_CONSTEXPR ConcreteType operator+(const ConcreteType& rhs) const
|
||||
|
Loading…
Reference in New Issue
Block a user