-
Notifications
You must be signed in to change notification settings - Fork 49
Add support for templated MxArray conversions #25
Comments
@dnmiller Hmm, you are right. Templated conversion might not work under current design. This is because there are a bunch of type inference for container template inside, and |
Yes, that appears to be what happened. I might try and work on this if I get some spare time. Any idea what a good approach might be? Make the type inference for fromInternal more restrictive? |
@dnmiller It would be great if you have a spare time to look into the issue. The current design defines type traits to instantiate various conversions based on type. It is probably easy to treat |
I would also be very much interested in this! |
Ah, I think I get it - in my case all template parameters are defined, so I am not hitting this problem, because I'm not templating my to/from methods. However, if I wanted to write a more generic conversion, then I'd have to "templatise" to/from and then I would hit this problem as well. |
Edit: Updating with new request, as my original code was incorrect.
I'd like to first say thank you for this library. It's very useful.
I was trying to extend MxArray with conversions to/from std::array and was running into problems with deducing the type/size of the array. If I make the
from
function not a member of MxArray, then I can implement the conversion:If I change
from
toMxArray::from
, then it won't compile.A similar attempt to implement the
to
function does not compile in either case:This would be a great feature to have for extending to templated data types.
The text was updated successfully, but these errors were encountered: