gloperate icon indicating copy to clipboard operation
gloperate copied to clipboard

Support connections between Slots whose types are implicitly convertible

Open j-o opened this issue 8 years ago • 3 comments

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)

j-o avatar Dec 09 '16 09:12 j-o

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.

scheibel avatar Dec 09 '16 10:12 scheibel

We may add support for this later in cppexpose by extending the Typed-interface

sbusch42 avatar Dec 09 '16 12:12 sbusch42

No rush, just a nice-to-have that came to my mind while playing with the new Slot interface.

j-o avatar Dec 09 '16 12:12 j-o