News for hackers. Stuff that matters.
Re:Array Iteration Interview Problem by pbsd on Wednesday August 01, 2012 @10:53PM (#4326970)
Overly complex C++11: http://ideone.com/yHzej

The output assembly is actually pretty good (std::vector specialization):

        ; prologue
    L19:
	add	eax, esi
	cmp	ebx, eax
	je	L4
    L8:
	mov	ecx, DWORD PTR [eax]
	cmp	ecx, DWORD PTR [edi]
	.p2align 4,,3
	jne	L10
	add	ecx, 1
	sub	edx, 1
	mov	DWORD PTR [eax], ecx
    L10:
	test	edx, edx
	jg	L19
    L4:
        ; epilogue

There are no comments on this comment yet.