Static array container type
Model Configuration Pane: Code Generation / Code Style
Description
Specify a container type for static arrays in the generated code. Choose either
C-style array
or std::array
.
Dependencies
To enable this parameter, set Language to
C++
and set Code interface packaging
to C++ class
.
Settings
C-style array
(default) | std::array
Default:
C-style array
C-style array
The code generator generates array containers by using C-style arrays.
std::array
std::array
is a template class that represents fixed-size arrays. If you choose this option, the code generator generates array containers by usingstd::array
.If the generated code contains multidimensional arrays, the code generator does not honor the
std::array
container type for arrays of more than one dimension.
Examples
Recommended Settings
Application | Setting |
---|---|
Debugging | No impact |
Traceability | No impact |
Efficiency | No impact |
Safety precaution | No recommendation |
Programmatic Use
Parameter:
ArrayContainerType |
Type: character vector |
Value:
'C-style array' |'std::array'
|
Default:
'C-style array' |
Limitations
This parameter does not affect static arrays in function interfaces. If a generated function takes a fixed-size array as an argument or returns a fixed-size array, the code generator generates that array as a C-style array regardless of the setting of this parameter.