Re: pass by ref, no matching overload found

Сергей Владимирович <[email protected]> Wed, 1 Apr 2015 01:45:29 +0300
Newsgroups gmane.comp.lang.lua.bind.user
Message-ID <CAF4f3cPxbzsCvHcVrMQVGB=GFjs0UKp76Ea1ZY81Za63zg-EcA@mail.gmail.com>
--===============7710623292968916250==
Content-Type: multipart/alternative; boundary=047d7bd6bb5afcb25205129d5a8f

--047d7bd6bb5afcb25205129d5a8f
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Thanks. Worked.

2015-04-01 0:41 GMT+03:00 Christian N. <[email protected]>:

> On 2015-03-31 23:33 +0200, =D0=A1=D0=B5=D1=80=D0=B3=D0=B5=D0=B9 =D0=92=D0=
=BB=D0=B0=D0=B4=D0=B8=D0=BC=D0=B8=D1=80=D0=BE=D0=B2=D0=B8=D1=87=D0=A1=D0=B5=
=D1=80=D0=B3=D0=B5=D0=B9 =D0=92=D0=BB=D0=B0=D0=B4=D0=B8=D0=BC=D0=B8=D1=80=
=D0=BE=D0=B2=D0=B8=D1=87 wrote:
>  > [...]
> >
> > I want to set tag for node from lua script:
> > node =3D scene:find ( "NewGameButton" )
> > node:setTag ( "scale", value )
> >
> > I get luabind error:
> > No matching overload found, candidates:
> > void setTag(Node&,std::string const&,std::string const&)
> >
> > But this line works fine
> > node:setTag ( "scale", "str_value" )
> >
> > How to get setTag working in both cases?
> >
>
> It seems that value is not a string. AFAIR luabind does not implicitly
> convert numbers to strings, so you should try
>
>      node:setTag ( "scale", tostring( value ) )
>
> where tostring() is a Lua standard library function
> (http://www.lua.org/manual/5.1/manual.html#pdf-tostring).
>
>
> -------------------------------------------------------------------------=
-----
> Dive into the World of Parallel Programming The Go Parallel Website,
> sponsored
> by Intel and developed in partnership with Slashdot Media, is your hub fo=
r
> all
> things parallel software development, from weekly thought leadership blog=
s
> to
> news, videos, case studies, tutorials and more. Take a look and join the
> conversation now. http://goparallel.sourceforge.net/
> _______________________________________________
> luabind-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/luabind-user
>

--047d7bd6bb5afcb25205129d5a8f
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Thanks. Worked.</div><div class=3D"gmail_extra"><br><div c=
lass=3D"gmail_quote">2015-04-01 0:41 GMT+03:00 Christian N. <span dir=3D"lt=
r">&lt;<a href=3D"mailto:[email protected]" target=3D"_blank">[email protected]</a>&gt;=
</span>:<br><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;bo=
rder-left:1px #ccc solid;padding-left:1ex">On 2015-03-31 23:33 +0200, =D0=
=A1=D0=B5=D1=80=D0=B3=D0=B5=D0=B9 =D0=92=D0=BB=D0=B0=D0=B4=D0=B8=D0=BC=D0=
=B8=D1=80=D0=BE=D0=B2=D0=B8=D1=87=D0=A1=D0=B5=D1=80=D0=B3=D0=B5=D0=B9 =D0=
=92=D0=BB=D0=B0=D0=B4=D0=B8=D0=BC=D0=B8=D1=80=D0=BE=D0=B2=D0=B8=D1=87 wrote=
:<br>
=C2=A0&gt; [...]<br>
<span class=3D"">&gt;<br>
&gt; I want to set tag for node from lua script:<br>
&gt; node =3D scene:find ( &quot;NewGameButton&quot; )<br>
&gt; node:setTag ( &quot;scale&quot;, value )<br>
&gt;<br>
&gt; I get luabind error:<br>
&gt; No matching overload found, candidates:<br>
&gt; void setTag(Node&amp;,std::string const&amp;,std::string const&amp;)<b=
r>
&gt;<br>
&gt; But this line works fine<br>
&gt; node:setTag ( &quot;scale&quot;, &quot;str_value&quot; )<br>
&gt;<br>
&gt; How to get setTag working in both cases?<br>
&gt;<br>
<br>
</span>It seems that value is not a string. AFAIR luabind does not implicit=
ly<br>
convert numbers to strings, so you should try<br>
<br>
=C2=A0 =C2=A0 =C2=A0node:setTag ( &quot;scale&quot;, tostring( value ) )<br=
>
<br>
where tostring() is a Lua standard library function<br>
(<a href=3D"http://www.lua.org/manual/5.1/manual.html#pdf-tostring" target=
=3D"_blank">http://www.lua.org/manual/5.1/manual.html#pdf-tostring</a>).<br=
>
<br>
---------------------------------------------------------------------------=
---<br>
Dive into the World of Parallel Programming The Go Parallel Website, sponso=
red<br>
by Intel and developed in partnership with Slashdot Media, is your hub for =
all<br>
things parallel software development, from weekly thought leadership blogs =
to<br>
news, videos, case studies, tutorials and more. Take a look and join the<br=
>
conversation now. <a href=3D"http://goparallel.sourceforge.net/" target=3D"=
_blank">http://goparallel.sourceforge.net/</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></div>

--047d7bd6bb5afcb25205129d5a8f--


--===============7710623292968916250==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
--===============7710623292968916250==
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

--===============7710623292968916250==--