Removes implicit conversions in std::complex #84
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
std::complex<_Tp>
assumes thatint, double, long double
are explicitly convertible to_Tp
. Currently,std::complex<_Tp>
also assumes that:int
is implicitly convertible to_Tp
, e.g., when usingcomplex<_Tp>(1)
.long double
can be attributed to a_Tp
variable, e.g., when usingconst _Tp __pi_2 = 1.5707963267948966192313216916397514L
.This PR removes assumptions (1) and (2), broadening the types
std::complex
supports. One example is the typeEigen::Half
in https://eigen.tuxfamily.org/dox-devel/Half_8h_source.html. This type does not implement implicit conversions.