[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: casting an 'int' to a class
From:       Simon Hausmann <hausmann () kde ! org>
Date:       2002-01-23 8:42:03
[Download RAW message or body]

On Tue, Jan 22, 2002 at 11:08:45AM -0500, Ellis Whitehead wrote:
> On Tuesday 22 January 2002 02:17 am, Simon Hausmann wrote:
> > Without:
> >     b = A( b ).transform( c );
> Something like this might work.  Or class A could be initialized with a 
> reference to 'int', making it just "A( b ).transform( c )" ?

Yup (although I think just reading the former is obvious, while
reading the latter requires taking a close look at A's constructor
(a '&' is a small sign :-)

> >     Or rather: don't store b as int in the first place.
> Not a viable option, I'm afriad, because the class needs to remain private 
> (it handles X-specific calls).

So put the class declaration in a private header (foo_p.h) and use
the member in a private d pointer (so you can still use it in your
class while it being hidden from the public API) ?


Simon
 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic