remodel icon indicating copy to clipboard operation
remodel copied to clipboard

How to use SIMD types

Open darknoon opened this issue 7 years ago • 1 comments

I tried this:

%library name="simd"
%type name=vector_int2 library=simd canForwardDeclare=false
MyObject {
  NSString *identifier
  vector_int2 position
}

Output:

[error][Thu Jan 24 2019 15:31:14 GMT-0500 (Eastern Standard Time)] [/REDACTED/Broken.value]The Description plugin does not know how to format the type "vector_int2" from MyObject.position. Did you forget to declare a backing type?
[/REDACTED/Broken.value]The Equality plugin does not know how to compare or hash the type "vector_int2" from MyObject.position. Did you forget to declare a backing type?
Successfuly generated 0 objects. Encountered 1 errors in other files

Based on the documentation for a value type, it seems like I can declare an "underlying" type, but vector_int2 can't be composed out of the builtin types.

How do I tell remodel that it's a value type you can compare with == and copy with =? Does this require changes to remodel-gen to support?

darknoon avatar Jan 24 '19 20:01 darknoon

This would require changes in remodel-gen to support unfortunately. We've added quite a few types to it but there isn't a flexible way of telling it about new types in configuration or the type definition :\ This is definitely something that should get added though (through some sort of per-plugin configuration that we could add into the .valueObjectConfig file likely?)

ColinCampbell avatar Jan 24 '19 21:01 ColinCampbell