const& , overflow and c++

Part 1

Constant references, instead of passing by value is it worth it (for 32 bit and smaller data types of course) ? tough to say, in most cases it surely isnt slower than passing by value, or maybe it is when the value u are passing is smaller than a reference (pointer) ? like passing a char is 1 byte but a const reference to a char is 4 byte (on 32 bit system). I really need to time it, but i guess it laso depends on compiler/processor. but for now i seem to be passing values by const& wherever possible in my code and cant seem to be able to stop, the only thing is function calls become too long ...

Part X

overflow, I started using bytes as indexes in a part of the code to save space, dont know if its really worth it, but i think it is, the problem now is letting the code warn u with overflow, so u start hacking checks using temporary variables and casts to see if the value changed sign/overflowed and the like, wont go into details, but i wonder why there isnt any overflow support in c/c++ itself, pretty annoying if u ask me ...

Comments

Posted by Menace  
on August 5, 2006, 12:10 pm
Posted by  
on September 4, 2007, 1:13 pm
Posted by  
on October 27, 2007, 1:08 am
Posted by  
on November 22, 2007, 12:30 am
Posted by  
on November 25, 2007, 2:30 pm
Posted by  
on December 3, 2007, 10:39 pm
Posted by  
on December 13, 2007, 1:11 am
Posted by  
on February 2, 2008, 1:27 pm
Posted by  
on March 26, 2008, 6:22 pm
Posted by  
on April 6, 2008, 12:47 pm
Posted by  
on April 6, 2008, 12:48 pm
Posted by  
on May 17, 2008, 4:09 pm
Posted by  
on June 2, 2008, 8:39 pm


 
Name

Email

URL


Remember me?

Comments


Verification code
Verification code