Replaced memcpy with std::copy, since the first one may work improperly with non POD data.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158457
91177308-0d34-0410-b5e6-
96231b3b80d8
void copyFrom(const self &RHS) {
- memcpy(Array, RHS.Array, sizeof(value_type) * (MaxArraySize + 1));
+ std::copy(RHS.Array, RHS.Array + MaxArraySize + 1, Array);
NumElements = RHS.NumElements;
}
void init () {
+ // Even if Array contains non POD, use memset for last element,
+ // since it is used as end() iterator only.
memset(Array + MaxArraySize, 0, sizeof(value_type));
NumElements = 0;
}