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

List:       kde-commits
Subject:    Re: KDE/kdelibs/knewstuff/knewstuff3
From:       André_Wöbbeking <Woebbeking () kde ! org>
Date:       2010-07-15 22:03:05
Message-ID: 201007160003.05744.Woebbeking () kde ! org
[Download RAW message or body]

On Thursday 15 July 2010, Frederik Gladhorn wrote:
> On Thursday 15 July 2010 21:51:03 Ömer Fadıl USTA wrote:
> > why the parameter "uint number" isn't a const value ?  i mean why not
> > "const uint number" ?
> > it isn't changing in this function so it might be much better to be const
> 
> the const makes only sense when passing references.

Why that? const improves readability (hey look, this variable isn't changed) and 
safety (damn, I changed the wrong variable by mistake).

> so for most data types
> you indeed want to pass "const type&" in order to avoid copying.
> for primitive types on the other hand, the const makes no sense since the
> passing of an int is not more expensive. please read up in c++ books about
> this.
[prev in list] [next in list] [prev in thread] [next in thread] 

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