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

List:       kde-core-devel
Subject:    Re: PATCH: adds KMIN/KMAX to kglobal.h
From:       Peter Putzer <pputzer () edu ! uni-klu ! ac ! at>
Date:       2000-10-15 16:28:22
[Download RAW message or body]

On Sun, 15 Oct 2000, Mario Weilguni wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> 
> Am Sunday 15 October 2000 18:16 schrieb Peter Putzer:
> 
> > > The attached patch adds KMIN/kMin and KMAX/kMax as typesafe inline
> > template functions.
> >
> > These should be used instead of QMIN/QMAX everywhere (Matthias Ettricht
> > agreed in private email that this would be a good idea, as Trolltech can't
> > include the proper functions in Qt due to the need to support older
> > compilers).
> >
> > If there are no complaints I'll commit the patch (or should I wait until
> > after 2.0?)
> 
> Why not expand the patch to use G++ min/max extensions. Since it's builtin it 
> might be faster/less memory consuming, and no need for templates
> 
> Something like this should do it:
> #if __GNUG__ >= 2
> #define KMIN(a,b) (a <? b)
> #define KMAX(a,b) (a >? b)
> #else
>  inlined version here
> #endif

Mhm, I don't see the need for a gcc-ism when The Standard Way works as
well.

Please understand that templates in this case mean only a compile time
overhead, not a code-size or runtime one.

bye,
Peter

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

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