sol2
sol2 copied to clipboard
Match overload based on usertype
I have two user types registered and I want to pass them to C++ and match an overload based on their type. Is that possible?
This is an example, but it doesn't work. Always goes to the first overload.
https://godbolt.org/z/8cW9ovWY7
Ah, on the type.
You can't do that right now because I didn't write a checker for this. This just grabs the table that repesents the usertype, not specifically that usertype. I could probably add a discriminator for this case in particular.
IF you're looking just for the value, that should work fine:
https://godbolt.org/z/vMnobvEzo
Yeah the value works fine, but I'm actually interested in the user type itself. Would be nice if that would be possible.