small patch

Friedrich W. H. Kossebau Friedrich.W.H at kossebau.de
Thu Mar 10 20:34:07 UTC 2005


Am Donnerstag, 10. März 2005 17:05, schrieb Bernd Schubert:
> On Thursday 10 March 2005 16:41, Paulo Moura Guedes wrote:
> > On Thursday 10 March 2005 00:42, Bernd Schubert wrote:
> > > The B. Stroustrup C++ book is in front of me, clearly stating that one
> > > shouldn't uses macros in C++. Thinking about it and having programmed
> > > the hole week in C, I believe its the most efficient way using this
> > > small macro for it...
> >
> > How about:
> > const char* PROFILEDIR = "kdevelop/profiles/";
> > ;)
>
> Well, correct me if I'm wrong, but won't this use memory while defining a
> constant with #define won't use additional memory for an additional
> variable? Of course, one could hope that the compiler will recognize and
> optimize it. I certainly considered this, but this is really one of the
> points I don't agree in with B. Stroustrup .

static const char PROFILEDIR[] = "kdevelop/profiles/";

should give you both, type checking in place and no extra variable/symbol left 
after compiling.

Regards
Friedrich
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20050310/4439fac4/attachment.sig>


More information about the KDevelop-devel mailing list