I am not sure capturing variables by reference implements the expected behavior; what would the equivalent C++ code return for this Go example?
func a() {
i := 0
defer fmt.Println(i)
i++
return
}