Topic: Container::max_size


Author: jpotter@falcon.lhup.edu (John Potter)
Date: 2000/03/02
Raw View
1.  I would like to conclude that max_size() <= difference_type max.
If not, distance(c.begin(), c.end()) could be negative.  Since I have
implementations for which my desired conclusion is not true, am I
missing something?

2.  The requirements for size_type are that it must be able to hold all
positive values of difference_type.  Does this allow a size_type which
uses one less bit than difference_type?  If so, negative values of
difference_type would map to size_type in the same range as the
positive values.  Is there something else which forces size_type to
use at least as many bits as difference_type?  This would force
negative values of difference_type to map to size_type values larger
than difference_type max.  I would also like this to be true.

Does the standard support my desires?  If not, why are they
unreasonable?

John

---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html              ]