Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove reinterpret_cast to std::complex<double> * in fields::process_incoming_chunk_data #2612

Merged
merged 1 commit into from
Aug 17, 2023

Conversation

oskooi
Copy link
Collaborator

@oskooi oskooi commented Aug 17, 2023

Fixes #2611.

According to this Stackoverflow thread, the C++ standard does not define the conversion of a double * to std::complex<double> * using reinterpret_cast. (The conversion in the reverse direction is defined, however.) This is probably why certain compilers have encountered the error reported in #2611.

@oskooi oskooi changed the title Remove reinterpret_cast to std::complex<double> * in fields::process_incoming_chunk_data` Remove reinterpret_cast to std::complex<double> * in fields::process_incoming_chunk_data Aug 17, 2023
@stevengj
Copy link
Collaborator

I'm confused as to why this cast would not be allowed?

@stevengj
Copy link
Collaborator

In any case, the new version is fine and has the virtue of eliminating pointer casts.

@stevengj stevengj merged commit f20ceab into NanoComp:master Aug 17, 2023
5 checks passed
@oskooi oskooi deleted the reinterpret_cast_bug branch August 17, 2023 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Occasional errors in fields::process_incoming_chunk_data from multiplying two std::complex<realnum> numbers
2 participants