Klaas Holwerda wrote: > klaas.holwerda wrote: > > >>> >>> >> Often defining the operator like: >> >> inline a2dTemplateFlag operator == ( a2dTemplateFlag a, a2dTemplateFlag b ) >> { >> return (a2dTemplateFlag) ( (int) a == (int) b ); >> } >> >> > > I see it is already in there, docviewref.h > > inline bool operator == (a2dTemplateFlag a, a2dTemplateFlag b) > { > return ( (long) a == (long) b ); > } > > What happens if you write: > > bool IsVisible() const { return ( a2dREFTEMPLATE_VISIBLE == > a2dREFTEMPLATE_VISIBLE); } > > > Klaas
1) bool IsVisible() const { return ((m_flags & a2dREFTEMPLATE_VISIBLE) == a2dREFTEMPLATE_VISIBLE); } produces Error E2015 C:\wxArt2D-head_borland\modules\docview/include/docviewref.h 2374: Ambiguity between 'operator ==(long,const wxLongLongNative &)' and '==' in function a2dDocumentTemplate::IsVisible() const Error E2015 C:\wxWidgets-2.8.7\include\wx/docview.h 293: Ambiguity between 'operator ==(long,const wxLongLongNative &)' and '==' in function wxDocTemplate::IsVisible() const 2) bool IsVisible() const { return (((a2dTemplateFlag)(m_flags & a2dREFTEMPLATE_VISIBLE) == (a2dTemplateFlag) a2dREFTEMPLATE_VISIBLE)); } produces Error E2015 C:\wxWidgets-2.8.7\include\wx/docview.h 293: Ambiguity between 'operator ==(long,const wxLongLongNative &)' and '==' in function wxDocTemplate::IsVisible() const 3) bool IsVisible() const { return ( a2dREFTEMPLATE_VISIBLE == a2dREFTEMPLATE_VISIBLE); } produces Error E2015 C:\wxWidgets-2.8.7\include\wx/docview.h 293: Ambiguity between 'operator ==(long,const wxLongLongNative &)' and '==' in function wxDocTemplate::IsVisible() const 4) bool IsVisible() const { return ((long)(a2dTemplateFlag)(m_flags & a2dREFTEMPLATE_VISIBLE) == (long)(a2dTemplateFlag)a2dREFTEMPLATE_VISIBLE); } produces Error E2015 C:\wxWidgets-2.8.7\include\wx/docview.h 293: Ambiguity between 'operator ==(long,const wxLongLongNative &)' and '==' in function wxDocTemplate::IsVisible() const It looks as though option 2 effectively operates correctly, so I would suggest going with option 2, but that still leaves the error from wxWidgets wxDocTemplate::IsVisible() ?? Best Regards Mal ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Wxart2d-users_dev mailing list Wxart2d-users_dev@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wxart2d-users_dev