Skip to content

Implicit Conversions #30

@jsallay

Description

@jsallay

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions