Re:My Favortie Bug (HP STL Problem) (Spelling)
on
Pet Bugs?
·
· Score: 2, Funny
Apparently I can't spell favorite right... Internal bug number #23456.
My Favortie Bug
on
Pet Bugs?
·
· Score: 2, Informative
Was having some really bizzare problems with our String class being used in a stl vector and ended up having to trace it into the RougeWave HP stl. It was in vector<_TypeT,_Allocator>::operator= (const vector<_TypeT,_Allocator>& __x) below is the change for anyone who might have hit this or runs this setup. Hope it can help someone avoid it and all the time it wasted. Just love problems in the STL! *** are the two lines changed.
copy (__x.begin (), __x.begin () + size (), begin ());
// write past original value of this->end () uninitialized_copy (__x.begin () + size (), __x.end (), begin () + size (), _RWSTD_VALUE_ALLOC_CAST (*this)); }
Apparently I can't spell favorite right... Internal bug number #23456.
Was having some really bizzare problems with our String class being used in a stl vector and ended up having to trace it into the RougeWave HP stl. It was in vector<_TypeT,_Allocator>::operator= (const vector<_TypeT,_Allocator>& __x)
// size() < _x.size() < capacity()
// advance this->end () first
// size() < _x.size() < capacity()
// advance this->end () first
// write past original value of this->end ()
below is the change for anyone who might have hit this or runs this setup. Hope it can help someone avoid it and all the time it wasted. Just love problems in the STL! *** are the two lines changed.
*** _C_end_of_storage = _C_finish = _C_start + __x.size();
}
else {
*** _C_end_of_storage = _C_finish = _C_start + __x.size ();
Changed To:
*** _C_finish = _C_start + __x.size();
}
else {
copy (__x.begin (), __x.begin () + size (), begin ());
uninitialized_copy (__x.begin () + size (), __x.end (),
begin () + size (),
_RWSTD_VALUE_ALLOC_CAST (*this));
}
*** _C_end_of_storage = _C_finish = _C_start + __x.size ();
This of course was becuase _C_end_of_storage should not have been set before the calling of size() as it would be incorrect.