// File: iZhangHui[P]CppPrimer/CH16_TemplatesAndGenericProgramming/examples/useBlob.cc
// Function: main
int main()
{
	Blob<string> b1; // empty Blob
	cout << b1.size() << endl;
	{  // new scope
		Blob<string> b2 = {"a", "an", "the"};
		b1 = b2;  // b1 and b2 share the same elements
		b2.push_back("about");
		cout << b1.size() << " " << b2.size() << endl;
	} // b2 is destroyed, but the elements it points to must not be destroyed
	cout << b1.size() << endl;
	for(auto p = b1.begin(); p != b1.end(); ++p)
		cout << *p << endl;

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1f0, %rsp            # imm = 0x1F0
movl $0x0, -0x4(%rbp)
leaq -0x18(%rbp), %rdi
movq %rdi, -0x120(%rbp)
callq 0x28f0
movq -0x120(%rbp), %rdi
callq 0x2910
movq %rax, -0x118(%rbp)
jmp 0x2377
movq -0x118(%rbp), %rsi
movq 0x7c3b(%rip), %rdi      # 0x9fc0
callq 0x2030
movq %rax, -0x128(%rbp)
jmp 0x2393
movq -0x128(%rbp), %rdi
movq 0x7bff(%rip), %rsi      # 0x9fa0
callq 0x2150
jmp 0x23a8
movb $0x1, -0xb4(%rbp)
leaq -0xa8(%rbp), %rax
movq %rax, -0x138(%rbp)
movq %rax, -0xb0(%rbp)
leaq -0xb1(%rbp), %rdi
movq %rdi, -0x130(%rbp)
callq 0x21f0
movq -0x138(%rbp), %rdi
movq -0x130(%rbp), %rdx
leaq 0x3c18(%rip), %rsi      # 0x6004
callq 0x2170
jmp 0x23f3
leaq -0x88(%rbp), %rax
movq %rax, -0x148(%rbp)
movq %rax, -0xb0(%rbp)
leaq -0xb2(%rbp), %rdi
movq %rdi, -0x140(%rbp)
callq 0x21f0
movq -0x148(%rbp), %rdi
movq -0x140(%rbp), %rdx
leaq 0x3bd6(%rip), %rsi      # 0x6006
callq 0x2170
jmp 0x2437
leaq -0x68(%rbp), %rax
movq %rax, -0x158(%rbp)
movq %rax, -0xb0(%rbp)
leaq -0xb3(%rbp), %rdi
movq %rdi, -0x150(%rbp)
callq 0x21f0
movq -0x158(%rbp), %rdi
movq -0x150(%rbp), %rdx
leaq 0x3b98(%rip), %rsi      # 0x6009
callq 0x2170
jmp 0x2478
movb $0x0, -0xb4(%rbp)
leaq -0xa8(%rbp), %rax
movq %rax, -0x48(%rbp)
movq $0x3, -0x40(%rbp)
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
leaq -0x38(%rbp), %rdi
callq 0x2940
jmp 0x24a5
leaq -0xa8(%rbp), %rax
movq %rax, -0x168(%rbp)
addq $0x60, %rax
movq %rax, -0x160(%rbp)
movq -0x160(%rbp), %rdi
addq $-0x20, %rdi
movq %rdi, -0x170(%rbp)
callq 0x20d0
movq -0x168(%rbp), %rcx
movq -0x170(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x160(%rbp)
jne 0x24be
leaq -0xb3(%rbp), %rdi
callq 0x2160
leaq -0xb2(%rbp), %rdi
callq 0x2160
leaq -0xb1(%rbp), %rdi
callq 0x2160
leaq -0x18(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x2970
leaq -0xd9(%rbp), %rdi
movq %rdi, -0x178(%rbp)
callq 0x21f0
movq -0x178(%rbp), %rdx
leaq 0x3acc(%rip), %rsi      # 0x600d
leaq -0xd8(%rbp), %rdi
callq 0x2170
jmp 0x254f
leaq -0x38(%rbp), %rdi
leaq -0xd8(%rbp), %rsi
callq 0x29a0
jmp 0x2561
leaq -0xd8(%rbp), %rdi
callq 0x20d0
leaq -0xd9(%rbp), %rdi
callq 0x2160
leaq -0x18(%rbp), %rdi
callq 0x2910
movq %rax, -0x180(%rbp)
jmp 0x258b
movq -0x180(%rbp), %rsi
movq 0x7a27(%rip), %rdi      # 0x9fc0
callq 0x2030
movq %rax, -0x188(%rbp)
jmp 0x25a7
movq -0x188(%rbp), %rdi
leaq 0x3a5e(%rip), %rsi      # 0x6013
callq 0x2120
movq %rax, -0x190(%rbp)
jmp 0x25c3
leaq -0x38(%rbp), %rdi
callq 0x2910
movq %rax, -0x198(%rbp)
jmp 0x25d5
movq -0x198(%rbp), %rsi
movq -0x190(%rbp), %rdi
callq 0x2030
movq %rax, -0x1a0(%rbp)
jmp 0x25f1
movq -0x1a0(%rbp), %rdi
movq 0x79a1(%rip), %rsi      # 0x9fa0
callq 0x2150
jmp 0x2606
leaq -0x38(%rbp), %rdi
callq 0x29d0
leaq -0x18(%rbp), %rdi
callq 0x2910
movq %rax, -0x1a8(%rbp)
jmp 0x2621
movq -0x1a8(%rbp), %rsi
movq 0x7991(%rip), %rdi      # 0x9fc0
callq 0x2030
movq %rax, -0x1b0(%rbp)
jmp 0x263d
movq -0x1b0(%rbp), %rdi
movq 0x7955(%rip), %rsi      # 0x9fa0
callq 0x2150
jmp 0x2652
leaq -0xf8(%rbp), %rdi
leaq -0x18(%rbp), %rsi
callq 0x29f0
jmp 0x2664
jmp 0x2666
leaq -0x110(%rbp), %rdi
leaq -0x18(%rbp), %rsi
callq 0x2a50
jmp 0x2678
leaq -0xf8(%rbp), %rdi
leaq -0x110(%rbp), %rsi
callq 0x2a20
movb %al, -0x1b1(%rbp)
jmp 0x2693
leaq -0x110(%rbp), %rdi
callq 0x2ac0
movb -0x1b1(%rbp), %al
testb $0x1, %al
jne 0x284b
leaq -0xf8(%rbp), %rdi
callq 0x2ac0
jmp 0x28b4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0x28d0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0x276c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0x2760
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0x2754
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0xa8(%rbp), %rax
movq %rax, -0x1c8(%rbp)
addq $0x60, %rax
movq %rax, -0x1c0(%rbp)
movq -0x1c0(%rbp), %rdi
addq $-0x20, %rdi
movq %rdi, -0x1d0(%rbp)
callq 0x20d0
movq -0x1c8(%rbp), %rcx
movq -0x1d0(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x1c0(%rbp)
jne 0x2721
jmp 0x2754
leaq -0xb3(%rbp), %rdi
callq 0x2160
leaq -0xb2(%rbp), %rdi
callq 0x2160
leaq -0xb1(%rbp), %rdi
callq 0x2160
testb $0x1, -0xb4(%rbp)
jne 0x2783
jmp 0x27d0
movq -0xb0(%rbp), %rax
leaq -0xa8(%rbp), %rcx
cmpq %rax, %rcx
movq %rax, -0x1d8(%rbp)
je 0x27ce
movq -0x1d8(%rbp), %rdi
addq $-0x20, %rdi
movq %rdi, -0x1e0(%rbp)
callq 0x20d0
movq -0x1e0(%rbp), %rax
leaq -0xa8(%rbp), %rcx
cmpq %rcx, %rax
movq %rax, -0x1d8(%rbp)
jne 0x279d
jmp 0x27d0
jmp 0x28d0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0x27fb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0xd8(%rbp), %rdi
callq 0x20d0
leaq -0xd9(%rbp), %rdi
callq 0x2160
jmp 0x2815
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x29d0
jmp 0x28d0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0x28a6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0x110(%rbp), %rdi
callq 0x2ac0
jmp 0x28a6
leaq -0xf8(%rbp), %rdi
callq 0x2ae0
movq %rax, -0x1e8(%rbp)
jmp 0x2860
movq -0x1e8(%rbp), %rsi
movq 0x7752(%rip), %rdi      # 0x9fc0
callq 0x2110
movq %rax, -0x1f0(%rbp)
jmp 0x287c
movq -0x1f0(%rbp), %rdi
movq 0x7716(%rip), %rsi      # 0x9fa0
callq 0x2150
jmp 0x2891
jmp 0x2893
leaq -0xf8(%rbp), %rdi
callq 0x2bb0
jmp 0x28a1
jmp 0x2666
leaq -0xf8(%rbp), %rdi
callq 0x2ac0
jmp 0x28d0
movl $0x0, -0x4(%rbp)
leaq -0x18(%rbp), %rdi
callq 0x29d0
movl -0x4(%rbp), %eax
addq $0x1f0, %rsp            # imm = 0x1F0
popq %rbp
retq
leaq -0x18(%rbp), %rdi
callq 0x29d0
movq -0x20(%rbp), %rdi
callq 0x21e0
nopw %cs:(%rax,%rax)
nopl (%rax)