box mybox(3) class instance 1 created from scratch constructed with argument 3 mybox = 4 class instance 2 created from scratch constructed with argument 4 class instance 1 assigned from instance 2 destroyed class instance 2 mybox = foo(mybox + (boxcast)1) class instance 3 created from scratch constructed with argument 1 entered function operator+(box&, box&) adding instances 1 and 3 converting class instance 1 to integer (value 4) converting class instance 3 to integer (value 1) class instance 4 created from scratch constructed with argument 5 leaving function operator+(box&, box&) entered function foo box bbox class instance 5 created from scratch default constructor bbox = abox + (boxcast)1 class instance 6 created from scratch constructed with argument 1 entered function operator+(box&, box&) adding instances 4 and 6 converting class instance 4 to integer (value 5) converting class instance 6 to integer (value 1) class instance 7 created from scratch constructed with argument 6 leaving function operator+(box&, box&) class instance 5 assigned from instance 7 destroyed class instance 7 destroyed class instance 6 return bbox converting class instance 5 to integer (value 6) destroyed class instance 5 leaving function foo destroyed class instance 4 class instance 8 created from scratch constructed with argument 6 class instance 1 assigned from instance 8 destroyed class instance 8 destroyed class instance 3 return 0 destroyed class instance 1