1

[x64][libc++]valgrind compains when using std::string::replace

view story
linux-howto

https://bbs.archlinux.org – This sample code#include <string> #include <iostream> int main () { std::string str("this is a test std::string."); str.replace(9, 5, "n example of"); std::cout << str << std::endl; str.replace(8, 2, "a short"); std::cout << str << std::endl; return 0; }run it with$ g++ sample.cpp && valgrind ./a.outthen valgrind says==8297== Source and destination overlap in memcpy(0x592f0e7, 0x592f0e2, 24) ==8297== at 0x4C27B46: memcpy (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==8297== by 0 (HowTos)