PacktPublishing / Template-Metaprogramming-with-CPP

Template Metaprogramming with C++, published by Packt
MIT License
90 stars 27 forks source link

Chapter 5 - Compile error GCC #6

Open ludvikjerabek opened 1 year ago

ludvikjerabek commented 1 year ago
/mnt/c/Users/ljerabek/Documents/GitHub/Template-Metaprogramming-with-CPP/src/chapter_05/main.cpp: In static member function ‘static constexpr OutputIt* n520::detail::copy_fn<true>::copy(InputIt*, InputIt*, OutputIt*)’:
/mnt/c/Users/ljerabek/Documents/GitHub/Template-Metaprogramming-with-CPP/src/chapter_05/main.cpp:430:18: error: ‘memmove’ is not a member of ‘std’; did you mean ‘wmemmove’?
  430 |             std::memmove(d_first, first, (last - first) * sizeof(InputIt));
      |                  ^~~~~~~
      |                  wmemmove

You must add the following header:

#include <cstring>