Archived

This forum has been archived. Please start a new discussion on GitHub.

3.5b: wrong method call to check existence of set optional data member

On Optional Data Members - Ice 3.5 - ZeroC
CPtr c = new C;
c->name = "xyz";           // required
c->active = true;          // required
c->alternateName = "abc";  // optional
c->overrideCode = 42;      // optional
 
if(c->alternateName)
    cout << "alt name = " << c->alternateName << endl;

Should the second to last line be:
if(c->hasAlternateName)

Comments

  • benoit
    benoit Rennes, France
    Hi,

    The manual is correct, the hasXxx methods are only present with the Java language mapping.

    Cheers,
    Benoit.
  • Hi Benoit,

    Thanks!

    Blair