[omniORB] idl mapping to structs

baileyk@slxi.com baileyk@slxi.com
Thu, 19 Jul 2001 13:02:29 -0500



If the IDL compiler uses namespaces, then StructTest will be a namespace
and can be re-opened.  Then you can put operator==() in the same scope as
SomeStruct, right?




                                                                                                                        
                    Leandro Fanzone                                                                                     
                    <leandro@hasar.com>                 To:     Kevin Bailey <ke-omniorb@retriever.dyndns.org>          
                    Sent by:                            cc:     omniorb-list@uk.research.att.com                        
                    owner-omniorb-list@uk.resear        Fax to:                                                         
                    ch.att.com                          Subject:     Re: [omniORB] idl mapping to structs               
                                                                                                                        
                                                                                                                        
                    07/19/2001 11:59 AM                                                                                 
                                                                                                                        
                                                                                                                        



I'm using gcc 3.0 and it compiles OK. It doesn't work without the
"StructTest::"
because I'm not within the structure and obviously the idea is to declare
the
operator== outside it to avoid derivation.

Kevin Bailey wrote:

> On Thu, Jul 19, 2001 at 12:57:18PM -0300, Leandro Fanzone wrote:
> >
> > bool
> > operator==(const StructTest::SomeStruct &Left, const
StructTest::SomeStruct
> > &Right)
> > {
> >     return Left.l == Right.l;
> > }
>
> That might work on gcc 2.95.x but gcc 3.x (and the new standard)
> require that operator== be declared in the same scope as the
> type it compares, so the StructTest:: should be unnecessary.