I often use .push_back(element)
when working with vector
, but I do not know what the maximum amount of elements I can add to a vector
before it overflows and performs the reallocation of a new space in memory.
Is there a mechanism I can use to know the maximum number of elements that vector
supports? This value is always the same, so if compiling for any machine this value will not change?