Commit 44c1de1b authored by Jan Möbius's avatar Jan Möbius

Merge branch 'checked-iterators-fix' into 'master'

attempt to quench 'Checked Iterator' warnings in VS2015

See merge request !107
parents 22554e00 f846b752
Pipeline #3572 passed with stage
in 41 minutes and 23 seconds
...@@ -182,8 +182,8 @@ class VectorT { ...@@ -182,8 +182,8 @@ class VectorT {
typename = typename std::enable_if< typename = typename std::enable_if<
std::is_convertible<OtherScalar, Scalar>::value>> std::is_convertible<OtherScalar, Scalar>::value>>
vector_type& operator=(const VectorT<OtherScalar, DIM>& _rhs) { vector_type& operator=(const VectorT<OtherScalar, DIM>& _rhs) {
std::transform(_rhs.data(), _rhs.data() + DIM, std::transform(_rhs.cbegin(), _rhs.cend(),
data(), [](OtherScalar rhs) { this->begin(), [](OtherScalar rhs) {
return static_cast<Scalar>(std::move(rhs)); return static_cast<Scalar>(std::move(rhs));
}); });
return *this; return *this;
...@@ -193,7 +193,7 @@ class VectorT { ...@@ -193,7 +193,7 @@ class VectorT {
Scalar* data() { return values_.data(); } Scalar* data() { return values_.data(); }
/// access to const Scalar array /// access to const Scalar array
const Scalar *data() const { return values_.data(); } const Scalar* data() const { return values_.data(); }
//----------------------------------------------------------- element access //----------------------------------------------------------- element access
...@@ -382,8 +382,8 @@ class VectorT { ...@@ -382,8 +382,8 @@ class VectorT {
auto operator|(const VectorT<OtherScalar, DIM>& _rhs) const -> auto operator|(const VectorT<OtherScalar, DIM>& _rhs) const ->
decltype(*this->data() * *_rhs.data()) { decltype(*this->data() * *_rhs.data()) {
return std::inner_product(data() + 1, data() + DIM, _rhs.data() + 1, return std::inner_product(begin() + 1, begin() + DIM, _rhs.begin() + 1,
*data() * *_rhs.data()); *begin() * *_rhs.begin());
} }
//------------------------------------------------------------ euclidean norm //------------------------------------------------------------ euclidean norm
...@@ -604,7 +604,7 @@ class VectorT { ...@@ -604,7 +604,7 @@ class VectorT {
template<typename Functor> template<typename Functor>
inline vector_type apply(const Functor& _func) const { inline vector_type apply(const Functor& _func) const {
vector_type result; vector_type result;
std::transform(result.values_.begin(), result.values_.end(), std::transform(result.values_.cbegin(), result.values_.cend(),
result.values_.begin(), _func); result.values_.begin(), _func);
return result; return result;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment