gloperate
gloperate copied to clipboard
Support connections between Slots whose types are implicitly convertible
I'm not sure how complicated this is to implement (if possible at all), but it would be great two slots could be connected if their types are convertible, e.g.:
Input<glm::ivec4> myIVec4Input;
Output<glm::vec4> myVec4Output;
myIVec4Input << myVec4Output;
Currently, this gives a compile error: binary '<<': no operator found which takes a right-hand operand of type 'gloperate::Input<glm::vec4>' (or there is no acceptable conversion)
We have such code for subclasses and their superclasses in gloperate 1.0 but this isn't handled well by MSVC.
However, this functionality was added because it doesn't require any actual conversion of data.
If you want to have such connections for, e.g., int <-> float
, there has to be an actual conversion step that is currently not planned in the interface.
Workaround: use a cppexpose::Variant
as the data type.
We may add support for this later in cppexpose by extending the Typed-interface
No rush, just a nice-to-have that came to my mind while playing with the new Slot interface.