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

Implicit Conversions #30

Open
jsallay opened this issue Jan 15, 2022 · 0 comments
Open

Implicit Conversions #30

jsallay opened this issue Jan 15, 2022 · 0 comments

Comments

@jsallay
Copy link
Collaborator

jsallay commented Jan 15, 2022

A pmt and several of the other classes defined (like pmtf::scalar) are very permissive classes on purpose. They can be constructed from a very wide variety of objects. We use templates to allow for this.

We have a problem with implicit conversions. For example, in the code right now, if I write: std::cout << std::vector<int>(4) << std::endl; . There is no operator<< defined for a vector, but I can create a pmt (or a pmtf::vector) from one. The compiler will do an implicit conversion to a pmt and then print the values out. This is not expected or desired behavior.

In order to fix this, we need to add SFINAE to each of the generic function calls. This needs to be done for all of the functions where an argument is a pmt or a wrapper function and we define multiple versions depending on the type passed in.

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

No branches or pull requests

1 participant