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 ...




Page :  1