Using unique_ptr is typically the better practice since it makes memory management automatic and makes ownership clear. Also use references when retrieving items from the span, and don't unnecessarily specify specific lambda captures. Pull Request: https://projects.blender.org/blender/blender/pulls/108510