[omniORB] Help: How to check that _var (_CORBA_ConstrType_Variable_Var) contains null (nil) object

Duncan Grisby duncan at grisby.org
Fri Jul 25 17:10:03 BST 2003


On Friday 18 July, Tomasz Bech wrote:

> The type _CORBA_ConstrType_Variable_Var has no T* operator and no is_nil 
> so there is not possible to write:
>    if ( MyVar==0)
> or if (MyVar.is_nil())
> 
> The extremely ugly way is :
> if (MyVar.operator->()==0)
> 
> 1. Did I miss something?

No.

> 2. Why there is no operator T* or funciton is_nil on var?

is_nil is only meaningful for object references. There is no T*
operator because that would break the memory management rules.

> 3. Is this ugly way the only one?

Yes, that's the only way.

Note that these aren't omniORB restrictions, they are restrictions in
the standard C++ mapping.

Cheers,

Duncan.

-- 
 -- Duncan Grisby         --
  -- duncan at grisby.org     --
   -- http://www.grisby.org --



More information about the omniORB-list mailing list