[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-core-devel
Subject: Re: KColorScheme - additional (convenience) ctors
From: Matthew Woehlke <mw_triad () users ! sourceforge ! net>
Date: 2007-09-02 18:06:12
Message-ID: fbeu2k$eek$1 () sea ! gmane ! org
[Download RAW message or body]
Simon Hausmann wrote:
> I suggest to change the signature of the constructor that takes a const
> QWidget & to take a const QWidget *. Nobody passes around QWidget references,
> so everyone using this constructor has to dereference the widget to pass for
> no good reason IMHO.
Thanks for the feedback. I thought about that also, the problem is that
passing a NULL reference is not valid. By requiring a reference rather
than a pointer, this makes it explicitly clear that you must pass in a
real object. Otherwise, the ctor has to either throw an exception or
abort(), neither of which it currently does.
So I guess my preference is to make people type an extra '*' (and to
force them to stop and think about what they're doing, which they need
to be doing either way). But I'm willing to reconsider. Which evil is
lesser?
--
Mathew
(sorry, .sig file is on the other computer)
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic