Is it good practice to use std::size_t all over the place?
Posted
by dehmann
on Stack Overflow
See other posts from Stack Overflow
or by dehmann
Published on 2010-06-06T22:45:46Z
Indexed on
2010/06/06
22:52 UTC
Read the original article
Hit count: 288
I have a lot of constants in my code that are unsigned numbers, e.g. counters, frequency cutoffs, lengths, etc. I started using std::size_t
for all of these, instead of int
or unsigned int
.
Is that the right thing to do? I started it because the STL containers use it for their sizes, it's used for string position, etc.
© Stack Overflow or respective owner