const and strict aliasing rules

2006-12-04 Thread John L. Kulp
I have a situation where I have a class that internally maintains a container object of non-const objects that it wants to publish to clients as a const container of const objects, that is, clients can't modify the list or the items in the list. The data member wants to be non-const because th

STL vector::resize

2007-08-16 Thread John L. Kulp
Shouldn't the last (optional) argument be (1) const and (2) a reference (rather than a potentially very expensive copying call-by-value)? Among other things, if you have a type declared with alignment attributes, it will fail on this. I notice the MSVC implementation has (1) but not (2). I c