tag_function<> under class_ gives me error C2825

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

tag_function<> under class_ gives me error C2825

Kristoffer Danielsson
Latest Luabind 0.9, VC10.
 
 
namespace LuaHelper
{
   inline void SetExpression(Script *pScript, boost::RegEx &r, const char *s) { ... }
}
 
Inside Script class:
luabind
::module(L)
[
   luabind::class_<boost::RegEx>("Regex")
   .def("SetExpression", luabind::tag_function<void(boost::RegEx&, const char*)>(boost::bind(&LuaHelper::SetExpression, this, _1)))
];
 
When compiling I get this error:
 
1>c:\program files (x86)\boost\boost_1_42\boost\bind\bind.hpp(69): error C2825: 'F': must be a class or namespace when followed by '::'
1>          c:\program files (x86)\boost\boost_1_42\boost\bind\bind_template.hpp(15) : see reference to class template instantiation 'boost::_bi::result_traits<R,F>' being compiled
1>          with
1>          [
1>              R=boost::_bi::unspecified,
1>              F=void (__cdecl *)(Script *,boost::RegEx &,const char *)
1>          ]
1>          c:\users\me\desktop\testapp2010\testapp\script.cpp(365) : see reference to class template instantiation 'boost::_bi::bind_t<R,F,L>' being compiled
1>          with
1>          [
1>              R=boost::_bi::unspecified,
1>              F=void (__cdecl *)(Script *,boost::RegEx &,const char *),
1>              L=boost::_bi::list2<boost::_bi::value<Script *>,boost::arg<1>>
1>          ]
 
 
I've tried to reorder the parameters, using _2 instead of _1 etc, but with no success. I've managed to do this with global functions, but inside classes I get this problem!
 
 
What am I doing wrong?
 
Thank you for your help!


Kom närmare dina vänner. Chatta och dela upplevelser med Messenger! Testa din dator här!
------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
luabind-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/luabind-user
Reply | Threaded
Open this post in threaded view
|

Singleton class produces "No matching overload found" when tagged

Kristoffer Danielsson
 
luabind::module(L)
[
   luabind::class_<boost::RegEx>("Regex")
   .def("set", luabind::tag_function<void(boost::RegEx&, const char*)>(boost::bind(&LuaHelper::SetExpression, this, _1, _2)))
];

 
luabind::globals(L)["Regex"] = &m_regex;
 
LUA:
Regex:set('test')
 
Luabind tells me this:
 
No matching overload found, candidates:
void set(custom [class Script]*,Regex&,char const*)

Sure I can make luabind aware of class Script, but it shouldn't be required. I have several tagged functions that accept a Script-pointer without producing an error.
 
I believe this has something to do with the global-stuff. Any ideas?
 
 
Please help!


Kom närmare dina vänner. Ring videosamtal med Messenger. Klicka här!
------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
luabind-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/luabind-user
Reply | Threaded
Open this post in threaded view
|

Re: Singleton class produces "No matching overload found" when tagged

Kristoffer Danielsson
Solved it. You can ignore this thread. Thanks :P


From: [hidden email]
To: [hidden email]
Date: Sun, 4 Jul 2010 22:45:06 +0200
Subject: [luabind] Singleton class produces "No matching overload found" when tagged

 
luabind::module(L)
[
   luabind::class_<boost::RegEx>("Regex")
   .def("set", luabind::tag_function<void(boost::RegEx&, const char*)>(boost::bind(&LuaHelper::SetExpression, this, _1, _2)))
];

 
luabind::globals(L)["Regex"] = &m_regex;
 
LUA:
Regex:set('test')
 
Luabind tells me this:
 
No matching overload found, candidates:
void set(custom [class Script]*,Regex&,char const*)

Sure I can make luabind aware of class Script, but it shouldn't be required. I have several tagged functions that accept a Script-pointer without producing an error.
 
I believe this has something to do with the global-stuff. Any ideas?
 
 
Please help!


Kom närmare dina vänner. Ring videosamtal med Messenger. Klicka här!

Kom närmare dina vänner. Ring videosamtal med Messenger. Klicka här!
------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
luabind-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/luabind-user
Reply | Threaded
Open this post in threaded view
|

Re: tag_function<> under class_ gives me error C2825

Max McGuire
In reply to this post by Kristoffer Danielsson
It looks like:

boost::bind(&LuaHelper::SetExpression, this, _1)

Should be:

boost::bind(&LuaHelper::SetExpression, this, _1, _2)

Max

--
Technical Director
Unknown Worlds Entertainment
http://www.unknownworlds.com


On Sat, Jul 3, 2010 at 6:11 AM, Kristoffer Danielsson <[hidden email]> wrote:
Latest Luabind 0.9, VC10.
 
 
namespace LuaHelper
{
   inline void SetExpression(Script *pScript, boost::RegEx &r, const char *s) { ... }
}
 
Inside Script class:
luabind
::module(L)
[
   luabind::class_<boost::RegEx>("Regex")
   .def("SetExpression", luabind::tag_function<void(boost::RegEx&, const char*)>(boost::bind(&LuaHelper::SetExpression, this, _1)))
];
 
When compiling I get this error:
 
1>c:\program files (x86)\boost\boost_1_42\boost\bind\bind.hpp(69): error C2825: 'F': must be a class or namespace when followed by '::'
1>          c:\program files (x86)\boost\boost_1_42\boost\bind\bind_template.hpp(15) : see reference to class template instantiation 'boost::_bi::result_traits<R,F>' being compiled
1>          with
1>          [
1>              R=boost::_bi::unspecified,
1>              F=void (__cdecl *)(Script *,boost::RegEx &,const char *)
1>          ]
1>          c:\users\me\desktop\testapp2010\testapp\script.cpp(365) : see reference to class template instantiation 'boost::_bi::bind_t<R,F,L>' being compiled
1>          with
1>          [
1>              R=boost::_bi::unspecified,
1>              F=void (__cdecl *)(Script *,boost::RegEx &,const char *),
1>              L=boost::_bi::list2<boost::_bi::value<Script *>,boost::arg<1>>
1>          ]
 
 
I've tried to reorder the parameters, using _2 instead of _1 etc, but with no success. I've managed to do this with global functions, but inside classes I get this problem!
 
 
What am I doing wrong?
 
Thank you for your help!


Kom närmare dina vänner. Chatta och dela upplevelser med Messenger! Testa din dator här!

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
luabind-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/luabind-user



------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
luabind-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/luabind-user
Reply | Threaded
Open this post in threaded view
|

Re: tag_function<> under class_ gives me error C2825

Kristoffer Danielsson
Yes, thank you!!
 

Date: Mon, 5 Jul 2010 16:24:46 -0700
From: [hidden email]
To: [hidden email]
Subject: Re: [luabind] tag_function<> under class_ gives me error C2825

It looks like:

boost::bind(&LuaHelper::SetExpression, this, _1)

Should be:

boost::bind(&LuaHelper::SetExpression, this, _1, _2)

Max

--
Technical Director
Unknown Worlds Entertainment
http://www.unknownworlds.com


On Sat, Jul 3, 2010 at 6:11 AM, Kristoffer Danielsson <[hidden email]> wrote:
Latest Luabind 0.9, VC10.
 
 
namespace LuaHelper
{
   inline void SetExpression(Script *pScript, boost::RegEx &r, const char *s) { ... }
}
 
Inside Script class:
luabind
::module(L)
[
   luabind::class_<boost::RegEx>("Regex")
   .def("SetExpression", luabind::tag_function<void(boost::RegEx&, const char*)>(boost::bind(&LuaHelper::SetExpression, this, _1)))
];
 
When compiling I get this error:
 
1>c:\program files (x86)\boost\boost_1_42\boost\bind\bind.hpp(69): error C2825: 'F': must be a class or namespace when followed by '::'
1>          c:\program files (x86)\boost\boost_1_42\boost\bind\bind_template.hpp(15) : see reference to class template instantiation 'boost::_bi::result_traits<R,F>' being compiled
1>          with
1>          [
1>              R=boost::_bi::unspecified,
1>              F=void (__cdecl *)(Script *,boost::RegEx &,const char *)
1>          ]
1>          c:\users\me\desktop\testapp2010\testapp\script.cpp(365) : see reference to class template instantiation 'boost::_bi::bind_t<R,F,L>' being compiled
1>          with
1>          [
1>              R=boost::_bi::unspecified,
1>              F=void (__cdecl *)(Script *,boost::RegEx &,const char *),
1>              L=boost::_bi::list2<boost::_bi::value<Script *>,boost::arg<1>>
1>          ]
 
 
I've tried to reorder the parameters, using _2 instead of _1 etc, but with no success. I've managed to do this with global functions, but inside classes I get this problem!
 
 
What am I doing wrong?
 
Thank you for your help!


Kom närmare dina vänner. Chatta och dela upplevelser med Messenger! Testa din dator här!

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
luabind-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/luabind-user




Kom närmare dina vänner. Chatta och dela upplevelser med Messenger! Testa din dator här!
------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
luabind-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/luabind-user