IBM Support

How do I turn off initialization of pointers to NULL in constructor?

Technote (FAQ)


Question

How do I turn off initialization of pointers to NULL in constructor?

Answer

I need to be able to turn off the generation of the code that initializes pointers to NULL in the constructor, for example:
 
Library::Library(const Book& aBook) : myBook(&aBook){
myBook = NULL;
//#[ operation Library(Book)
//#]
}
 
The code I do NOT want to generate is "myBook = NULL"
 
Solution:
Uncheck the property CG::Relation::SafeInitScalar for myBook and regenerate code.
1417AnswerProduct versionPartner ContentInternal ContentCategoryReference IDAuthor

Historical Number

10380

Document information

More support for: Rational Rhapsody
General Information

Software version: Version Independent

Operating system(s): Platform Independent

Reference #: 1323679

Modified date: 23 November 2010