Use std::copy to copy array and remove user destructor to make sure is_trivially_copyable in order to avoid -Wno-error=nontrivial-memcall (#6029)

Use std::copy to copy array and remove user destructor to make sure is_trivially_copyable in order to avoid -Wno-error=nontrivial-memcall (#6029)
This commit is contained in:
T.Yamada
2025-03-11 15:09:10 +01:00
committed by GitHub
parent 70459b4d1f
commit f398a70163
5 changed files with 1 additions and 14 deletions
+1 -5
View File
@@ -985,7 +985,7 @@ inline void GetArrayCopy(Type *&dest, ai_uint num) {
Type *old = dest;
dest = new Type[num];
::memcpy(dest, old, sizeof(Type) * num);
std::copy(old, old+num, dest);
}
// ------------------------------------------------------------------------------------------------
@@ -1095,10 +1095,6 @@ void SceneCombiner::Copy(aiMesh **_dest, const aiMesh *src) {
// make a deep copy of all faces
GetArrayCopy(dest->mFaces, dest->mNumFaces);
for (unsigned int i = 0; i < dest->mNumFaces; ++i) {
aiFace &f = dest->mFaces[i];
GetArrayCopy(f.mIndices, f.mNumIndices);
}
// make a deep copy of all blend shapes
CopyPtrArray(dest->mAnimMeshes, dest->mAnimMeshes, dest->mNumAnimMeshes);