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 ); } So i am suprized the next two are oke inline a2dTemplateFlag operator | (a2dTemplateFlag a, a2dTemplateFlag b) { return (a2dTemplateFlag) ( (long) a | (long) b ); } inline a2dTemplateFlag operator & (a2dTemplateFlag a, a2dTemplateFlag b) { return (a2dTemplateFlag) ( (long) a & (long) b ); } In here: void SetVisible( bool value ) { value?(m_flags = m_flags | a2dREFTEMPLATE_VISIBLE) : m_flags = m_flags & ( a2dREFTEMPLATE_ALLSET ^ a2dREFTEMPLATE_VISIBLE ); } //! Returns true if the document template is marked , false otherwise. void SetMarked( bool value ) { value?(m_flags = m_flags | a2dREFTEMPLATE_MARK) : m_flags = m_flags & ( a2dREFTEMPLATE_ALLSET ^ a2dREFTEMPLATE_MARK ); } What happens if you write: bool IsVisible() const { return ( a2dREFTEMPLATE_VISIBLE == a2dREFTEMPLATE_VISIBLE); } Klaas -- Unclassified ------------------------------------------------------------------------- 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