From 9352473d596e431e2d493b3968fca6b0f973f431 Mon Sep 17 00:00:00 2001 From: ThePhD Date: Sun, 12 Jun 2016 05:21:45 -0400 Subject: [PATCH] Oopsies with index / new_index. Should fix @billw2012 's problem from #71 --- sol/usertype_metatable.hpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sol/usertype_metatable.hpp b/sol/usertype_metatable.hpp index fb2bcb45..6685f862 100644 --- a/sol/usertype_metatable.hpp +++ b/sol/usertype_metatable.hpp @@ -184,6 +184,11 @@ namespace sol { mustindex = true; return; } + else if (shimname == name_of(meta_function::new_index)) { + newindexfunc = call; + mustindex = true; + return; + } l[index] = usertype_detail::make_reg(std::forward(n), make_func(std::forward(f))); ++index; }();