Browse Source

Math: don't allow implicit conversion of T to Complex<T>.

Brain failure #1.
pull/278/head
Vladimír Vondruš 13 years ago
parent
commit
1eea843538
  1. 2
      src/Math/Complex.h
  2. 2
      src/Math/Test/ComplexTest.cpp

2
src/Math/Complex.h

@ -94,7 +94,7 @@ template<class T> class Complex {
* c = a + ib
* @f]
*/
inline constexpr /*implicit*/ Complex(T real, T imaginary = T(0)): _real(real), _imaginary(imaginary) {}
inline constexpr /*implicit*/ Complex(T real, T imaginary): _real(real), _imaginary(imaginary) {}
/**
* @brief Construct complex number from vector

2
src/Math/Test/ComplexTest.cpp

@ -97,8 +97,6 @@ void ComplexTest::construct() {
Complex c(0.5f, -3.7f);
CORRADE_COMPARE(c.real(), 0.5f);
CORRADE_COMPARE(c.imaginary(), -3.7f);
CORRADE_COMPARE(Complex(2.0f), Complex(2.0f, 0.0f));
}
void ComplexTest::constructDefault() {

Loading…
Cancel
Save