Book a Demo

Author Topic: C++ code gen. problem?  (Read 3573 times)

Duc-bert

  • EA User
  • **
  • Posts: 27
  • Karma: +0/-0
  • I love YaBB 1 Gold!
    • View Profile
C++ code gen. problem?
« on: May 22, 2002, 03:16:11 pm »
Hi,

running build 490, I'm adding a method to a class, one of method's parameter is inout so it appears in my class diagram as void method( int& param ) but when I generate the C++ code the "&" does not appear in the method signature. Did I do something wrong? I check the C++ Code Gen setting and the Default Reference Type is Reference(&).

by the way, how do I specify a "const" param? ( example, void method ( const int& param ) )

Please help
thanks  ???
« Last Edit: May 22, 2002, 03:27:34 pm by Duc-bert »

Robert

  • Guest
Re: C++ code gen. problem?
« Reply #1 on: May 24, 2002, 04:00:33 am »
Hi,
If you only use the 'kind' as documentation and always specify the types in full "std::string&" you will be fine.
The 'fixed' option adds a const to the front.
You will also have fun when using const pointers to const :-)
(you will need to specify the type as "T* const" and then make the param const/fixed.)
The return type is much the same, specify it in full!

As an aside, I think the user interface could do with some rationalisation of approaches, but this may be add odds with the UML standard. e.g. use of fixed and const, the attributes being value or reference but params in/out, etal.

Robert