Suppose I have the following code:

```
std::vector<chaiscript::Boxed_Value> vals;
chai.add(chaiscript::fun([&vals](chaiscript::Boxed_Value x)
{ vals.push_back(x); }),
"add");
chai.eval("for (var i = 0; i < 5; ++i) { add(i) }");
```

Now if I print out the contents of `vals`

, I’ll get `5 5 5 5 5`

. I would instead like to see `0 1 2 3 4`

. I’m guessing the problem is that `Boxed_Value`

really stores a reference to `i`

inside ChaiScript, and so I’m just seeing the last value. How can I make a copy of the value in each call of `add()`

?