You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
The text was updated successfully, but these errors were encountered: