guillaumeblanc / ozz-animation

Open source c++ skeletal animation library and toolset
http://guillaumeblanc.github.io/ozz-animation/
Other
2.46k stars 302 forks source link

Fixes deprecated implicit copy warning #153

Closed cmey closed 2 years ago

cmey commented 2 years ago

Hi and thanks for this wonderful library! I'm proposing a fix for some compilation warnings.

Compiling with warning flag -Wdeprecated-copy (part of -Wextra) produced this type of warning on clang and gcc:

/home/cmey/Code/cpp/ozz-animation/include/ozz/base/span.h:65:8: warning: definition of implicit copy constructor for 'span<const ozz::animation::Float3Key>' is deprecated because it has a user-provided copy assignment operator [-Wdeprecated-copy-with-user-provided-copy]
  void operator=(const span& _other) {
       ^
/home/cmey/Code/cpp/ozz-animation/include/ozz/animation/runtime/animation.h:92:48: note: in implicit copy constructor for 'ozz::span<const ozz::animation::Float3Key>' first required here
  span<const Float3Key> translations() const { return translations_; }

Easy steps to repro on develop:

cmake -D CMAKE_CXX_FLAGS="-Wdeprecated-copy" ../
cmake --build .

I saw 2 occurrences of the warning so there are 2 changes:

This clears the warnings reported above.

I've followed the Contributing guidelines:

Hope this helps!

guillaumeblanc commented 2 years ago

Sorry for the late answer. Many thanks for the pull request and for taking care of following the guidelines !

Cheers, Guillaume

cmey commented 2 years ago

@guillaumeblanc Do you mind making a new release with this fix? maybe a minor version bump to 0.14.1 ? :pray: