Commit b0f7f8b0 authored by Hans-Christian Ebke's avatar Hans-Christian Ebke
Browse files

Fixed VectorT::operator| and operator>>.

parent fc5c715d
...@@ -357,8 +357,7 @@ class VectorT { ...@@ -357,8 +357,7 @@ class VectorT {
template<typename OtherScalar, template<typename OtherScalar,
typename ResultScalar = decltype( typename ResultScalar = decltype(
std::declval<Scalar>() * std::declval<const OtherScalar &>())> std::declval<Scalar>() * std::declval<const OtherScalar &>())>
typename std::enable_if<DIM == 3, ResultScalar>::type ResultScalar operator|(const VectorT<OtherScalar, DIM>& _rhs) const {
operator|(const VectorT<OtherScalar, DIM>& _rhs) const {
ResultScalar p = values_[0] * _rhs[0]; ResultScalar p = values_[0] * _rhs[0];
for (int i = 1; i < DIM; ++i) { for (int i = 1; i < DIM; ++i) {
p += values_[i] * _rhs[i]; p += values_[i] * _rhs[i];
...@@ -603,7 +602,7 @@ operator<<(std::ostream& os, const VectorT<Scalar, DIM> &_vec) { ...@@ -603,7 +602,7 @@ operator<<(std::ostream& os, const VectorT<Scalar, DIM> &_vec) {
/// read the space-separated components of a vector from a stream /// read the space-separated components of a vector from a stream
template<typename Scalar, int DIM> template<typename Scalar, int DIM>
typename std::enable_if<sizeof(decltype( typename std::enable_if<sizeof(decltype(
std::declval<std::ostream>() >> std::declval<std::istream>() >>
std::declval<const Scalar &>())) >= 0, std::istream&>::type std::declval<const Scalar &>())) >= 0, std::istream&>::type
operator>> (std::istream& is, VectorT<Scalar, DIM> &_vec) { operator>> (std::istream& is, VectorT<Scalar, DIM> &_vec) {
for (int i = 0; i < DIM; ++i) for (int i = 0; i < DIM; ++i)
......
Supports Markdown
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