microsoft / glTF-Toolkit

A collection of tools for modifying and optimizing glTF assets
MIT License
295 stars 41 forks source link

Update SerializeBinary to accept an rvalue for for GLBStreamFactor #26

Closed benbuzbee closed 6 years ago

benbuzbee commented 6 years ago

Since SerializeBinary will eventually invoke the move constructor of its std::unique_ptr parameter, it would be more correct to only allow the parameter to bind to an rvalue.

This prevents the parameter from being expected to outlive the call, and allows the function to be called in a more natural way - one that doesn't require an intermediate stack variable that is unusable after the call.

robertos commented 6 years ago

I'm OK with this, even though it has a breaking change. @erikdahlstrom @mtungekar Any issues with this approach?

mtungekar commented 6 years ago

No issue.