[omniORB] operator * for _var types?

Michael Teske mteske-csk at t-online.de
Wed Jul 23 18:33:38 BST 2008


Hi!

Clarke Brunt wrote:
>> I always get the "no operator *" error message on the indicated line.
> The other
>> orb in question does provide such an operator and in my corba book i
> see it
>> mentioned, too.
> 
> Perhaps tell us the context in which it is mentioned and which book. I
> see no sign of the operator in the copy of the C++ Language Mapping for
> CORBA which I'm looking at.

This is in Chapter 4 of PURE CORBA by Fintan Bolton in the context of deep copy.
It also references the _var types as "smart pointers" (which usually can be 
dereferenced). But books can be wrong, of course.

>> I know I could write X::Y y = f
> 
> I might be wrong, but could you?? I wouldn't have expected that to work
> either.

At least it compiles with gcc 4.3...

> I guess you're hoping for a deep copy of the structure in y? It seems an
> unusual requirement. You could easily create another _var with such a

This is not exactly where it's used in our code, I probably oversimplified.
What is done in our code is, suppose you have a function

void foo (const X::Y &x)
{
// whatever
}

and a
X::Y_var y;
one would call
foo(*y);

here
foo(y) compiles as well.

another example is if X::Y is a sequence type, I see
(*y)[n] being used a lot...

But anyway, if this is really nonstandard, I'll have to change the code in question.


> statement, i.e. X::Y_var y = f.
> 
> The horrid construct:
> X::Y y = *(f.operator->()) would presumably work.

This would be really horrible :)

Greetings,
   Michael




More information about the omniORB-list mailing list