Fix LuaBindings TypeList copy-ctor
authorRobin Gareus <robin@gareus.org>
Sat, 18 Mar 2017 17:28:44 +0000 (18:28 +0100)
committerRobin Gareus <robin@gareus.org>
Sat, 18 Mar 2017 17:30:51 +0000 (18:30 +0100)
Determining the class type copy constructed references.
Const-references passed to C++ functions were copies.

libs/lua/LuaBridge/detail/TypeList.h

index fc4ce399c7b3300713f35721746d43e5632b8deb..52284a4adf115b3fe65cb436f0a6262c2b88ef29 100644 (file)
@@ -99,7 +99,7 @@ struct TypeListValues <TypeList <Head, Tail> >
 template <typename Head, typename Tail>
 struct TypeListValues <TypeList <Head&, Tail> >
 {
-  Head hd;
+  Head& hd;
   TypeListValues <Tail> tl;
 
   TypeListValues (Head& hd_, TypeListValues <Tail> const& tl_)
@@ -123,7 +123,7 @@ struct TypeListValues <TypeList <Head&, Tail> >
 template <typename Head, typename Tail>
 struct TypeListValues <TypeList <Head const&, Tail> >
 {
-  Head hd;
+  const Head& hd;
   TypeListValues <Tail> tl;
 
   TypeListValues (Head const& hd_, const TypeListValues <Tail>& tl_)