size_t vs size_type and ptrdiff_t vs difference_type

Sep 21, 2014 at 12:16pm
Are there any differences between these types?
Last edited on Sep 21, 2014 at 12:16pm
Sep 21, 2014 at 12:46pm
size_type and difference_type are class member types which gives information about concrete type used in implementation, which may be or not be equal to size_t/prtdiff_t

Generally, types size_t and ptrdiff_t should be threated as size_type and difference_type for c-arrays and pointers respectively as those entities are not classes and cannot contain member types.

[skipped] vs [skipped]
Use auto.
Topic archived. No new replies allowed.