I am puzzled with the following 2 simple snippets: #include <vector> struct A{ int foo(int i) const {return v[i];} std::vector<int> v; }; int f(const A &a, int i) { int j; j=a.foo(i); j=a.foo(i); return j; } which gives the assembly code: movsxd rax, esi mov rcx, qword ptr [rdi] mov eax, dword ptr [rcx + ..
Recent Comments