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

Confusing convert.hpp class #170

Open
gbalduzz opened this issue Feb 7, 2020 · 0 comments
Open

Confusing convert.hpp class #170

gbalduzz opened this issue Feb 7, 2020 · 0 comments
Labels
question Further information is requested

Comments

@gbalduzz
Copy link
Contributor

gbalduzz commented Feb 7, 2020

I was looking at the class in include/dca/phys/domains/convert.hpp as it gave me problems with changes to variadic template helpers and got quite confused.
Why do we have all this machinery, a generic class convert<To, From> which is specialized only from electron band and spin to the spin_band domain, using static memory allocations and template overloading while a simple function return band + BDmn::dmn_size() + to_coordinate(spin) would suffice?
There is this if condition:

if (std::is_same<dca::util::TypeAt<0, parameter_typelist>::type, domains::electron_band_domain>::value) 

which trivially evaluates to true for how the code is written. It seems like its only purpose is to confuse the reader.
Can I remove it, and possibly remove the whole class for a single, non templated function call?

@gbalduzz gbalduzz added the question Further information is requested label Feb 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant