示例,其中std :: array :: max_size和std :: array :: size给出不同的结果

use*_*009 6 c++ arrays stl stdarray

每当我尝试max_size()和使用size()std::array,我得到相同的结果,我想知道是否可能存在两种情况给出不同结果的情况.

Ser*_*eyA 6

该函数存在与其他容器的兼容性std::vector.对于std::array这两个值将始终是相同的.


Bau*_*gen 5

这两个函数将始终返回相同的值,即Na std::array<T, N>.

提供它们是为了与其他容器保持一致,其值将不同(例如std::vector).