Skip to content

Commit

Permalink
Math: don't allow implicit conversion of T to Complex<T>.
Browse files Browse the repository at this point in the history
Brain failure #1.
  • Loading branch information
mosra committed Feb 27, 2013
1 parent 6edc26f commit 1eea843
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 1 addition & 1 deletion src/Math/Complex.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions src/Math/Test/ComplexTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit 1eea843

Please sign in to comment.