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

List:       kde-devel
Subject:    Re: Const pointers
From:       Shaheed <srhaque () iee ! org>
Date:       2004-11-07 15:06:31
Message-ID: 200411071506.31508.srhaque () iee ! org
[Download RAW message or body]


> This code is fine, but a pointer to an int is the same size as an int, so
> there's not much point in doing this optimisation.  const int x    is fine.
> If the object is larger than int, then do the const &   trick.

No, they are not the same size - you are making assumption that the language 
does not support.

For example, while x86 is usually these days an ILP32 model, the "native"  
programming model on 64 bit architectures is usually LP64: on those platforms 
you are actually consuming more resources than needed.
 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread] 

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