C++ Logo


Advanced search

Why is size_type in std::array an alias for size_t?

From: Wilhelm Meier <wilhelm.meier_at_[hidden]>
Date: Fri, 8 Nov 2019 07:46:22 +0100
Hello all,

the member type size_type is an alias for size_t in std::array:


The member type size_type in std::vector is an unspecified unsigned
integer type:


I wonder, if this is intentional, since std::array could declare the
size_type depending on the actual size of the array, e.g. an
implementation could declare size_type an alias to uint8_t if the size
of the array is less than 256 or uint16_t if the size of the array is
less than 65536.

Is this a documentation issue?


Received on 2019-11-08 00:48:43