Just some quick things:
unsigned int width
doesn't need to beconst
since it's passed-by-value. But that's not really significant as the compiler will optimize away theconst
if needed.Prefer
size_t
size_t
for types representing sizes. It's also useful for loop counters as you'll be able to loop through any size of data supported by your computer. However, you'll receive type-matching warnings if your counter and size types are not both signed or unsigned. In this case, usingint
(which is a signed type) will cause such warnings if the size type is unsigned.
Just some quick things:
unsigned int width
doesn't need to beconst
since it's passed-by-value. But that's not really significant as the compiler will optimize away theconst
if needed.Prefer
size_t
for types representing sizes. It's also useful for loop counters as you'll be able to loop through any size of data supported by your computer. However, you'll receive type-matching warnings if your counter and size types are not both signed or unsigned. In this case, usingint
(which is a signed type) will cause such warnings if the size type is unsigned.
Just some quick things:
unsigned int width
doesn't need to beconst
since it's passed-by-value. But that's not really significant as the compiler will optimize away theconst
if needed.Prefer
size_t
for types representing sizes. It's also useful for loop counters as you'll be able to loop through any size of data supported by your computer. However, you'll receive type-matching warnings if your counter and size types are not both signed or unsigned. In this case, usingint
(which is a signed type) will cause such warnings if the size type is unsigned.
Just some quick things:
unsigned int width
doesn't need to be aconst
parameter since it's a builtpassed-in type, but it'sby-value. But that's not really a big dealsignificant as such uses ofthe compiler will optimize away theconst
don't hurt. Just wanted to make a note about thatif needed.Prefer
size_t
size_t
for types representing sizes. This can replace everyint
It's also useful for such variables, especially the loop countercounters as you'll be able to loop through any size of data supported by your computer. You'll get However, you'll receive type-matching warnings if your counter type differs from theand size type in the looptypes are not both signed or unsigned. In most casesthis case, usingint
(which is a signed type) will cause such warnings since it also uses negative numbersif the size type is unsigned.
Just some quick things:
unsigned int width
doesn't need to be aconst
parameter since it's a built-in type, but it's not really a big deal as such uses ofconst
don't hurt. Just wanted to make a note about that.Prefer
size_t
for types representing sizes. This can replace everyint
for such variables, especially the loop counter. You'll get type-matching warnings if your counter type differs from the size type in the loop. In most cases, usingint
will cause such warnings since it also uses negative numbers.
Just some quick things:
unsigned int width
doesn't need to beconst
since it's passed-by-value. But that's not really significant as the compiler will optimize away theconst
if needed.Prefer
size_t
for types representing sizes. It's also useful for loop counters as you'll be able to loop through any size of data supported by your computer. However, you'll receive type-matching warnings if your counter and size types are not both signed or unsigned. In this case, usingint
(which is a signed type) will cause such warnings if the size type is unsigned.
Just some quick things:
const unsigned int width
doesn't needneed to be aconst
parameter since it's a built-in type, but it's not really a big deal as such uses ofconst
don't hurt. Just wanted to make a note about that.Prefer
size_t
for types representing sizes. This can replace everyint
for such variables, especially the loop counter. You'll get type-matching warnings if your counter type differs from the size type in the loop. In most cases, usingint
will cause such warnings since it also uses negative numbers.
Just some quick things:
const unsigned int width
doesn't need to beconst
since it's a built-in type, but it's not really a big deal as such uses ofconst
don't hurt. Just wanted to make a note about that.Prefer
size_t
for types representing sizes. This can replace everyint
for such variables, especially the loop counter. You'll get type-matching warnings if your counter type differs from the size type in the loop. In most cases, usingint
will cause such warnings since it also uses negative numbers.
Just some quick things:
unsigned int width
doesn't need to be aconst
parameter since it's a built-in type, but it's not really a big deal as such uses ofconst
don't hurt. Just wanted to make a note about that.Prefer
size_t
for types representing sizes. This can replace everyint
for such variables, especially the loop counter. You'll get type-matching warnings if your counter type differs from the size type in the loop. In most cases, usingint
will cause such warnings since it also uses negative numbers.