Re: binding reference to scalar types: shouldn't it work already?
Szymon Gatner <[email protected]> Thu, 18 Apr 2013 09:49:50 +0200
| Newsgroups | gmane.comp.lang.lua.bind.user |
|---|---|
| Message-ID | <CALqx0+U_tCdtS50fPuuvuq3mirYnA8UEctQnwFbupnqd_PLGBg@mail.gmail.com> |
--===============0021443242383822353== Content-Type: multipart/alternative; boundary=047d7b6d9354f360b004da9dd803 --047d7b6d9354f360b004da9dd803 Content-Type: text/plain; charset=ISO-8859-1 boost::ref creates object of type boost::reference_wrapper<T> not T&. This type obviously isn't known to luabind. 2013/4/10 Lorenzo Pistone <[email protected]> > Hello, > I'm trying to bind a reference to a bool. This thing compiles: > > globals(L)["dotrap"] = boost::ref(dotrap); > > but at compile time I get the following exception: > > terminate called after throwing an instance of 'std::runtime_error' > what(): Trying to use unregistered class > > It looks like that luabind is treating a reference to a bool as a user > defined type. So... it isn't able by default to bind references to > simple bools? > By the way, luabind does know about bool, in fact I can do > > globals(L)["dotrap"] = dotrap; > > but here I create a copy of the value, which is not what I want to do. > > Cheers. > > > ------------------------------------------------------------------------------ > Precog is a next-generation analytics platform capable of advanced > analytics on semi-structured data. The platform includes APIs for building > apps and a phenomenal toolset for data science. Developers can use > our toolset for easy data analysis & visualization. Get a free account! > http://www2.precog.com/precogplatform/slashdotnewsletter > _______________________________________________ > luabind-user mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/luabind-user > -- Szymon Gatner The Lordz Games Studio www.thelordzgamesstudio.com --047d7b6d9354f360b004da9dd803 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr">boost::ref creates object of type boost::reference_wrapper= <T> not T&. This type obviously isn't known to luabind.</div>= <div class=3D"gmail_extra"><br><br><div class=3D"gmail_quote">2013/4/10 Lor= enzo Pistone <span dir=3D"ltr"><<a href=3D"mailto:[email protected]= " target=3D"_blank">[email protected]</a>></span><br> <blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p= x #ccc solid;padding-left:1ex">Hello,<br> I'm trying to bind a reference to a bool. This thing compiles:<br> <br> =A0 =A0 =A0globals(L)["dotrap"] =3D boost::ref(dotrap);<br> <br> but at compile time I get the following exception:<br> <br> =A0 =A0 =A0terminate called after throwing an instance of 'std::runtime= _error'<br> =A0 =A0 =A0 =A0what(): =A0Trying to use unregistered class<br> <br> It looks like that luabind is treating a reference to a bool as a user<br> defined type. So... it isn't able by default to bind references to<br> simple bools?<br> By the way, luabind does know about bool, in fact I can do<br> <br> =A0 =A0 =A0globals(L)["dotrap"] =3D dotrap;<br> <br> but here I create a copy of the value, which is not what I want to do.<br> <br> Cheers.<br> <br> ---------------------------------------------------------------------------= ---<br> Precog is a next-generation analytics platform capable of advanced<br> analytics on semi-structured data. The platform includes APIs for building<= br> apps and a phenomenal toolset for data science. Developers can use<br> our toolset for easy data analysis & visualization. Get a free account!= <br> <a href=3D"http://www2.precog.com/precogplatform/slashdotnewsletter" target= =3D"_blank">http://www2.precog.com/precogplatform/slashdotnewsletter</a><br= > _______________________________________________<br> luabind-user mailing list<br> <a href=3D"mailto:[email protected]">[email protected]= urceforge.net</a><br> <a href=3D"https://lists.sourceforge.net/lists/listinfo/luabind-user" targe= t=3D"_blank">https://lists.sourceforge.net/lists/listinfo/luabind-user</a><= br> </blockquote></div><br><br clear=3D"all"><div><br></div>-- <br>Szymon Gatne= r<br>The Lordz Games Studio<br><a href=3D"http://www.thelordzgamesstudio.co= m" target=3D"_blank">www.thelordzgamesstudio.com</a> </div> --047d7b6d9354f360b004da9dd803-- --===============0021443242383822353== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ------------------------------------------------------------------------------ Precog is a next-generation analytics platform capable of advanced analytics on semi-structured data. The platform includes APIs for building apps and a phenomenal toolset for data science. Developers can use our toolset for easy data analysis & visualization. Get a free account! http://www2.precog.com/precogplatform/slashdotnewsletter --===============0021443242383822353== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ luabind-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/luabind-user --===============0021443242383822353==--