pass by ref, no matching overload found

Сергей Владимирович <[email protected]> Wed, 1 Apr 2015 00:33:16 +0300
Newsgroups gmane.comp.lang.lua.bind.user
Message-ID <CAF4f3cNbx_UR9PVrb_hdk_R7HiLkALAqLmPLmPpjA7qv4TeJww@mail.gmail.com>
--===============9084306239484226555==
Content-Type: multipart/alternative; boundary=047d7bdca5b6bf914b05129c586d

--047d7bdca5b6bf914b05129c586d
Content-Type: text/plain; charset=UTF-8

I want to pass parameters in method by reference.

class Node : public EventReceiver
{
public:
virtual void setTag ( const std::string& name, const std::string& value )
...
};

And this is luabind code to expose Node to lua:
class_<Node, EventReceiver> ( "Node" )
.def ( constructor<> () )
.def ( "setTag", &Node::setTag )
...

I want to set tag for node from lua script:
node = 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?

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

<div dir=3D"ltr"><div>I want to pass parameters in method by reference.</di=
v><div><br></div><div>class Node : public EventReceiver</div><div>{</div><d=
iv>public:</div><div><span class=3D"" style=3D"white-space:pre">	</span>vir=
tual void setTag ( const std::string&amp; name, const std::string&amp; valu=
e )</div><div><span class=3D"" style=3D"white-space:pre">	</span>...</div><=
div>};</div><div><br></div><div>And this is luabind code to expose Node to =
lua:</div><div><span class=3D"" style=3D"white-space:pre">	</span>class_&lt=
;Node, EventReceiver&gt; ( &quot;Node&quot; )</div><div><span class=3D"" st=
yle=3D"white-space:pre">		</span>.def ( constructor&lt;&gt; () )</div><div>=
<span class=3D"" style=3D"white-space:pre">		</span>.def ( &quot;setTag&quo=
t;, &amp;Node::setTag )</div><div><span class=3D"" style=3D"white-space:pre=
">		</span>...</div><div><br></div><div>I want to set tag for node from lua=
 script:</div><div>node =3D scene:find ( &quot;NewGameButton&quot; )</div><=
div>node:setTag ( &quot;scale&quot;, value )</div><div><br></div><div>I get=
 luabind error:</div><div>No matching overload found, candidates:</div><div=
>void setTag(Node&amp;,std::string const&amp;,std::string const&amp;)</div>=
<div><br></div><div>But this line works fine</div><div>node:setTag ( &quot;=
scale&quot;, &quot;str_value&quot; )</div><div><br></div><div>How to get se=
tTag working in both cases?</div></div>

--047d7bdca5b6bf914b05129c586d--


--===============9084306239484226555==
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/
--===============9084306239484226555==
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

--===============9084306239484226555==--