From 1be01b716ba1564aae0c3f18431efc71608d99b9 Mon Sep 17 00:00:00 2001 From: ThePhD Date: Wed, 5 Oct 2016 21:26:06 -0400 Subject: [PATCH] fix example assert --- examples/usertype_var.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/examples/usertype_var.cpp b/examples/usertype_var.cpp index 23774418..9f56490a 100644 --- a/examples/usertype_var.cpp +++ b/examples/usertype_var.cpp @@ -32,10 +32,14 @@ int main() { // number is its own memory: was passed by value // So does not change - assert(lua["test"]["ref_number"] == 25); + assert(lua["test"]["ref_number"] == 542); // ref_number is just test::number // passed through std::ref // so, it holds a reference + // which can be updated + // be careful about referencing local variables, + // if they go out of scope but are still reference + // you'll suffer dangling reference bugs! return 0; } \ No newline at end of file