Skip to content

Fix SmallVector move constructor and move assignment for move-only types - #148

Open
jihaohaaaa wants to merge 1 commit into
spnda:mainfrom
jihaohaaaa:fix-smallvector-move
Open

Fix SmallVector move constructor and move assignment for move-only types#148
jihaohaaaa wants to merge 1 commit into
spnda:mainfrom
jihaohaaaa:fix-smallvector-move

Conversation

@jihaohaaaa

Copy link
Copy Markdown

When FASTGLTF_USE_CUSTOM_SMALLVECTOR is enabled, SmallVector(SmallVector&&) and SmallVector::operator=(SmallVector&&) previously invoked copy(), which uses copy assignment *result++ = *first. For types with deleted copy constructors/assignments (such as Primitive containing std::unique_ptr), this caused compilation errors when moving SmallVector. This PR introduces a move_elements helper function to perform std::move instead of copying.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant