[ZOOM] Constructors (Was: Catching up)

Mike Taylor mike at tecc.co.uk
Wed Nov 14 13:47:32 CET 2001


> Date: Wed, 14 Nov 2001 12:19:12 +0000
> From: Ashley Sanders <zzaascs at irwell.mimas.ac.uk>
> 
> > P.S.  C'mon Ashley, where's 1.0g?!  :-)
> 
> I was going to try and do it yesterday, but 53 ZOOM emails just
> proved too much for me.

:-)

Thanks for catching up, anyway.  I'm going to reply to your message in
a sequence of smaller ones rather than one big one, in the hope that
people will feel more motivated to reply to individual points.  (Big
messages can be intimidating.)

> Re: Discussion about constructors of connection class.
> 
> My understranding was that zoom.hh was the public interface to ZOOM
> and so anything not explicitly declared public was therefore
> private.

Indeed.  What I was bitching about is not anything that you or anyone
else in the ZOOM group has done, but what I consider a gross wart in
C++ itself -- namely, the fact that the public interface is changed by
what does or does not appear in the "private:" part of a class.  That
seems badly wrong to me, but we just have to live with it.

> So the fact that constructors aren't shown doesn't mean that C++ can
> go and create default constructors, but does mean that they are
> private.

Ce n'est pas ca.  In C++, if you don't declare a constructor, the
language supplies a C-like default one.  So much as I hate to do this,
I think that the public header-file, the one that specifies the
interface, is going to have to include a visible constructor in the
"private:" section of some classes in order to prevent this.

> We do need to make this explicit somewhere

Yup -- a short comment on the private constructor should do it.

> (and I'm not sure we yet have all the constructors correct anyway.)

True -- but a different issue, I think.

The best way to find out whether we've got all the bases covered for
constructors is probably for you to bash out 1.0h (or I can do this
revision if you prefer?) so that we have something concrete to
criticise.

 _/|_	 _______________________________________________________________
/o ) \/  Mike Taylor   <mike at miketaylor.org.uk>   www.miketaylor.org.uk
)_v__/\  "Your karma just ran over my dogma" -- Walter Benesch.




More information about the ZOOM mailing list