Doesn&#x27;t the std::vector calls mess things up? Now the compiler has to track those as well, they involve the allocator which calls into the OS.<p>So for the compiler to be able to statically compute the result it would need to know that the std::vector stuff doesn&#x27;t have side effects.<p>Of course, the compiler could have special knowledge of std::vector, like for example in general it has about memcpy.