Bruno Pagès wrote:Edit the generation settings, go in the tab C++5 and modify the definitions as you want, adding '//' before the forms using or removing the second line to not have the forms using
Ok, got that.
Warning, if you use the stereotype 'vector' the code generation will replace '${stereotype}' by 'vector', not 'std::vector', if you want 'std::vector' you have to use the stereotype 'std::vector' etc
This is what I did - not sure if all these steps are needed.
#1 Edit default stereotypes - > class - >added 'std::vector' to attribute stereotypes line.
#2 Edit generations settings -> stereotypes -> added uml = std::vector , c++ = std::vector to attributes and relations...
#3 Edit generations settings -> c++[5] -> added std:vector as external type, and #include <vector> types
Test: on a class add attributes
m_vector, stereotype: vector, type: double, multiplicity *
m_stdvec, stereotype: std::vector, type: double, multiplicity *
Running generate c++, I get:
- Code: Select all
#include <vector>
// using namespace std;
class Test {
private:
vector<double> m_vector;
std::vector<float> m_stdvec;
};
So seems to work as expected.
But in the project browser I notice that the attribute lines look like:
- Code: Select all
a- <<vector>> m_vector
a- <<:vector>> m_stdvec
So, a visual bug as it does not show std::vector ?
Thanks.