|
|
|
|
|
Re: [C++ Gen] Is there a way to initialize a slot with a defining feature of multiplicity * ? [message #1849356 is a reply to message #1849319] |
Thu, 13 January 2022 15:34 |
|
Hi Yoann,
you're right, the C++ code generator currently does not properly support the initialization of a multi-valued attribute. One problem, is that this initialization code depends on the specific mapping which can be configured via the ListHint stereotype. Eventually, the hint also needs to provide information how to access an element. Feel free to create a bug.
In cases of a mapping to arrays, a workaround is the initialization with a single slot, e.g. "{ value1, value2, ... , valueN }". But this does not work for a mapping to std::vector, which needs an initialization in the constructor (vector<...> vect{ value1, value2, ... }) - there are many other ways to do it, of course.
Ansgar
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04473 seconds