; Looking at the assembly of the program (created with g++ -S -O5), you ; will find that the compiler created three copies of the length function. ; You call this "polymorphism"? ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; _Z6lengthIiEiP4cellIT_E: .LFB1759: pushl %ebp .LCFI11: movl %esp, %ebp .LCFI12: movl 8(%ebp), %edx xorl %eax, %eax testl %edx, %edx je .L505 .p2align 2,,3 .L503: movl 4(%edx), %edx incl %eax testl %edx, %edx jne .L503 .L505: leave ret _Z6lengthIdEiP4cellIT_E: .LFB1760: pushl %ebp .LCFI13: movl %esp, %ebp .LCFI14: movl 8(%ebp), %edx xorl %eax, %eax testl %edx, %edx je .L512 .p2align 2,,3 .L510: movl 8(%edx), %edx incl %eax testl %edx, %edx jne .L510 .L512: leave ret _Z6lengthISsEiP4cellIT_E: .LFB1761: pushl %ebp .LCFI15: movl %esp, %ebp .LCFI16: movl 8(%ebp), %edx xorl %eax, %eax testl %edx, %edx je .L519 .p2align 2,,3 .L517: movl 4(%edx), %edx incl %eax testl %edx, %edx jne .L517 .L519: leave ret