1
Bugs and Issues / Re: C++ Code generation inout parameters
« on: March 05, 2012, 11:34:47 pm »
Thanks Simon for the reply.
I am fully aware that my workaround has a plethora of unwanted side-effects. It is a Friday afternoon hack I made being slightly disgruntled after spending half a day reading documentation, trying to fix the behavior in my model.
Neither the Source Code import documentation nor the C or C++ Source Code generation documentation mention that the direction is simply ignored.
The different ways of representing references in C++ is troublesome for code-synchronization. Now the strange thing is that even in plain old C parameter references are ignored - AFAIK there is only one way (pointer) to describe references...
The only workaround that works, is to use references during modeling, making the type of an argument int* or Class& to model inout parameters.
BTW - are there templates I could modify for Code import/ synchronization?
I hope in future versions this will be resolved.
Best regards
Thomas
I am fully aware that my workaround has a plethora of unwanted side-effects. It is a Friday afternoon hack I made being slightly disgruntled after spending half a day reading documentation, trying to fix the behavior in my model.
Neither the Source Code import documentation nor the C or C++ Source Code generation documentation mention that the direction is simply ignored.
The different ways of representing references in C++ is troublesome for code-synchronization. Now the strange thing is that even in plain old C parameter references are ignored - AFAIK there is only one way (pointer) to describe references...
The only workaround that works, is to use references during modeling, making the type of an argument int* or Class& to model inout parameters.
BTW - are there templates I could modify for Code import/ synchronization?
I hope in future versions this will be resolved.
Best regards
Thomas