CreateTypeInstance
CreateTypeInstance[type,arg1,arg2,…]
creates an instance of a type in compiled code.
CreateTypeInstance[productType,field1x1,field2x2,… >]
creates an instance of a product type and initializes its fields.
Details
- The arguments in CreateTypeInstance[type,arg1,arg2,…] can vary from type to type and are often documented with the type itself.
- For many types, CreateTypeInstance[type,arg] creates a copy of arg if arg is an instance of type.
- Some types that can be instantiated with CreateTypeInstance are not automatically memory managed and must be manually freed with DeleteObject.
Examples
open allclose allBasic Examples (2)
Scope (1)
Custom usages of CreateTypeInstance can be declared with FunctionDeclaration:
Compile a function that uses the custom constructor for the type:
Text
Wolfram Research (2022), CreateTypeInstance, Wolfram Language function, https://reference.wolfram.com/language/ref/CreateTypeInstance.html.
CMS
Wolfram Language. 2022. "CreateTypeInstance." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/CreateTypeInstance.html.
APA
Wolfram Language. (2022). CreateTypeInstance. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/CreateTypeInstance.html