PacktPublishing / Template-Metaprogramming-with-CPP

Template Metaprogramming with C++, published by Packt
MIT License
82 stars 25 forks source link

Chapter 5 - Compile error GCC #6

Open ludvikjerabek opened 10 months ago

ludvikjerabek commented 10 months 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>