Cleanup: simplify subclassing CPPType

`CPPType` can wrap any C++ type so that code can work
with the wrapped type in a generic way. The goal of subclassing
`CPPType` is to provide additional methods for some types.
For example, the `CPPType` for `Array<int>` could have a `.element_type()`
method that returns the `CPPType` for `int`.
This commit is contained in:
2021-08-02 12:43:35 +02:00
parent aa60416361
commit 8edb2222ae
3 changed files with 142 additions and 152 deletions

View File

@@ -263,7 +263,7 @@ static Array<MFOutputSocket *> add_constant_folded_sockets(const MultiFunction &
const CPPType &cpp_type = data_type.single_type();
GMutableSpan array = params.computed_array(param_index);
void *buffer = array.data();
scope.add(buffer, array.type().members().destruct, AT);
scope.add(buffer, array.type().destruct_fn(), AT);
constant_fn = &scope.construct<CustomMF_GenericConstant>(AT, cpp_type, buffer);
break;