Home Bug Reports

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

blairblair Member Blair ZajacOrganization: Sony Pictures ImageworksProject: VnP ✭✭
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

  • benoitbenoit Rennes, FranceAdministrators, ZeroC Staff Benoit FoucherOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    Hi,

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

    Cheers,
    Benoit.
  • blairblair Member Blair ZajacOrganization: Sony Pictures ImageworksProject: VnP ✭✭
    Hi Benoit,

    Thanks!

    Blair
Sign In or Register to comment.