c++ - STL size_type(-1) vs size_t(-1) -
this question has answer here:
in c++ stl implementation, see code block:
size_type max_size() const { return size_type(-1); }
i understand works when size_type size_t. purpose of adding indirect level here? i.e. why not use size_t(-1)
directly in max_size()
?
is there specification says (size_type(-1)) should evaluate maximum object size on platform)...
Comments
Post a Comment