VC10 and out_value policy compile issues

[email protected]
Newsgroups gmane.comp.lang.lua.bind.user
Message-ID <[email protected]>
I am having a problem and it seems after searching on the net it's
happening to others as well. However, I can not seem to see any replies on
how to fix it.

I am using Microsoft Visual C++ 2010, Boost 1.43, Lua 5.1.4, LuaBind 0.9

I have a class defined like so in C++:

class TestOutPolicy
{
public:
    TestOutPolicy(void){};
    ~TestOutPolicy(void){};

    void GetValue(const std::string& key, std::string& returnValue){
returnValue = "Got It";}

};


I bind the class like so:

    luabind::module(lb)[
        luabind::class_<TestOutPolicy>("TestOutPolicy")
                .def(luabind::constructor<>())
		.def("GetValue", &TestOutPolicy::GetValue, luabind::out_value(_3))
    ];


The errors when you attempt to compile using either the luabind::out_value
or luabind::pure_out_value are as follows:



1>c:\3rdparty\lua\luabind-0.9\luabind\out_value_policy.hpp(78): error
C2784: 'luabind::detail::char_array<sizeof(identity<T>::type)>
luabind::detail::indirect_sizeof_test(luabind::detail::by_value<T>)' :
could not deduce template argument for 'luabind::detail::by_value<T>' from
'luabind::detail::by_reference<T>'
1>          with
1>          [
1>              T=std::string
1>          ]
1>          c:\3rdparty\lua\luabind-0.9\luabind\out_value_policy.hpp(71) :
see declaration of 'luabind::detail::indirect_sizeof_test'
1>          c:\3rdparty\lua\luabind-0.9\luabind\out_value_policy.hpp(160)
: see reference to class template instantiation
'luabind::detail::indirect_sizeof<T>' being compiled
1>          with
1>          [
1>              T=a2
1>          ]
1>         
c:\3rdparty\boost\boost_1_43_0\boost\mpl\aux_\preprocessed\plain\apply_wrap.hpp(49)
: see reference to class template instantiation
'luabind::detail::out_value_policy<BOOST_PP_ITERATION_0,Policies>::apply<T,Direction>'
being compiled
1>          with
1>          [
1>              BOOST_PP_ITERATION_0=3,
1>              Policies=luabind::detail::null_type,
1>              T=a2 ,
1>              Direction=luabind::detail::lua_to_cpp
1>          ]
1>         
c:\3rdparty\boost\boost_1_43_0\boost\preprocessor\iteration\detail\local.hpp(40)
: see reference to class template instantiation
'boost::mpl::apply_wrap2<F,T1,T2>' being compiled
1>          with
1>          [
1>              F=p2,
1>              T1=a2,
1>              T2=luabind::detail::lua_to_cpp
1>          ]
1>          c:\3rdparty\lua\luabind-0.9\luabind\detail\call.hpp(78) : see
reference to function template instantiation 'int
luabind::detail::invoke_member<F,boost::mpl::vector4<T0,T1,T2,T3>,Policies>(lua_State
*,const luabind::detail::function_object &,luabind::detail::invoke_context
&,const F &,Signature,const Policies
&,boost::mpl::long_<N>,boost::mpl::true_)' being compiled
1>          with
1>          [
1>              F=void (__thiscall TestOutPolicy::* )(const std::string
&,std::string &),
1>              T0=void,
1>              T1=TestOutPolicy &,
1>              T2=const std::string &,
1>              T3=std::string &,
1>             
Policies=luabind::detail::policy_cons<luabind::detail::out_value_policy<3,luabind::detail::null_type>,luabind::detail::null_type>,
1>              Signature=boost::mpl::vector4<void,TestOutPolicy &,const
std::string &,std::string &>,
1>              N=3
1>          ]
1>          c:\3rdparty\lua\luabind-0.9\luabind\detail\call.hpp(101) : see
reference to function template instantiation 'int
luabind::detail::invoke0<F,boost::mpl::vector4<T0,T1,T2,T3>,Policies,boost::is_void<void>>(lua_State
*,const luabind::detail::function_object &,luabind::detail::invoke_context
&,const F &,Signature,const Policies &,IsVoid,boost::mpl::true_)' being
compiled
1>          with
1>          [
1>              F=void (__thiscall TestOutPolicy::* )(const std::string
&,std::string &),
1>              T0=void,
1>              T1=TestOutPolicy &,
1>              T2=const std::string &,
1>              T3=std::string &,
1>             
Policies=luabind::detail::policy_cons<luabind::detail::out_value_policy<3,luabind::detail::null_type>,luabind::detail::null_type>,
1>              Signature=boost::mpl::vector4<void,TestOutPolicy &,const
std::string &,std::string &>,
1>              IsVoid=boost::is_void<void>
1>          ]
1>          c:\3rdparty\lua\luabind-0.9\luabind\make_function.hpp(41) :
see reference to function template instantiation 'int
luabind::detail::invoke<F,boost::mpl::vector4<T0,T1,T2,T3>,Policies>(lua_State
*,const luabind::detail::function_object &,luabind::detail::invoke_context
&,const F &,Signature,const Policies &)' being compiled
1>          with
1>          [
1>              F=void (__thiscall TestOutPolicy::* )(const std::string
&,std::string &),
1>              T0=void,
1>              T1=TestOutPolicy &,
1>              T2=const std::string &,
1>              T3=std::string &,
1>             
Policies=luabind::detail::policy_cons<luabind::detail::out_value_policy<3,luabind::detail::null_type>,luabind::detail::null_type>,
1>              Signature=boost::mpl::vector4<void,TestOutPolicy &,const
std::string &,std::string &>
1>          ]
1>          c:\3rdparty\lua\luabind-0.9\luabind\make_function.hpp(40) :
while compiling class template member function 'int
luabind::detail::function_object_impl<F,Signature,Policies>::call(lua_State
*,luabind::detail::invoke_context &) const'
1>          with
1>          [
1>              F=void (__thiscall TestOutPolicy::* )(const std::string
&,std::string &),
1>              Signature=boost::mpl::vector4<void,TestOutPolicy &,const
std::string &,std::string &>,
1>             
Policies=luabind::detail::policy_cons<luabind::detail::out_value_policy<3,luabind::detail::null_type>,luabind::detail::null_type>
1>          ]
1>          c:\3rdparty\lua\luabind-0.9\luabind\make_function.hpp(103) :
see reference to class template instantiation
'luabind::detail::function_object_impl<F,Signature,Policies>' being
compiled
1>          with
1>          [
1>              F=void (__thiscall TestOutPolicy::* )(const std::string
&,std::string &),
1>              Signature=boost::mpl::vector4<void,TestOutPolicy &,const
std::string &,std::string &>,
1>             
Policies=luabind::detail::policy_cons<luabind::detail::out_value_policy<3,luabind::detail::null_type>,luabind::detail::null_type>
1>          ]
1>          c:\3rdparty\lua\luabind-0.9\luabind\class.hpp(312) : see
reference to function template instantiation 'luabind::adl::object
luabind::make_function<F,boost::mpl::vector4<T0,T1,T2,T3>,Policies>(lua_State
*,F,Signature,Policies)' being compiled
1>          with
1>          [
1>              F=void (__thiscall TestOutPolicy::* )(const std::string
&,std::string &),
1>              T0=void,
1>              T1=TestOutPolicy &,
1>              T2=const std::string &,
1>              T3=std::string &,
1>             
Policies=luabind::detail::policy_cons<luabind::detail::out_value_policy<3,luabind::detail::null_type>,luabind::detail::null_type>,
1>              Signature=boost::mpl::vector4<void,TestOutPolicy &,const
std::string &,std::string &>
1>          ]
1>          c:\3rdparty\lua\luabind-0.9\luabind\class.hpp(310) : while
compiling class template member function 'void
luabind::detail::memfun_registration<Class,F,Policies>::register_(lua_State
*) const'
1>          with
1>          [
1>              Class=TestOutPolicy,
1>              F=void (__thiscall TestOutPolicy::* )(const std::string
&,std::string &),
1>             
Policies=luabind::detail::policy_cons<luabind::detail::out_value_policy<3,luabind::detail::null_type>,luabind::detail::null_type>
1>          ]
1>          c:\3rdparty\lua\luabind-0.9\luabind\class.hpp(828) : see
reference to class template instantiation
'luabind::detail::memfun_registration<Class,F,Policies>' being compiled
1>          with
1>          [
1>              Class=TestOutPolicy,
1>              F=void (__thiscall TestOutPolicy::* )(const std::string
&,std::string &),
1>             
Policies=luabind::detail::policy_cons<luabind::detail::out_value_policy<3,luabind::detail::null_type>,luabind::detail::null_type>
1>          ]
1>          c:\3rdparty\lua\luabind-0.9\luabind\class.hpp(585) : see
reference to function template instantiation 'luabind::class_<T>
&luabind::class_<T>::virtual_def<F,DefaultOrPolicies>(const char *,const F
&,const Policies &,luabind::detail::null_type,boost::mpl::true_)' being
compiled
1>          with
1>          [
1>              T=TestOutPolicy,
1>              F=void (__thiscall TestOutPolicy::* )(const std::string
&,std::string &),
1>             
DefaultOrPolicies=luabind::detail::policy_cons<luabind::detail::out_value_policy<3,luabind::detail::null_type>,luabind::detail::null_type>,
1>             
Policies=luabind::detail::policy_cons<luabind::detail::out_value_policy<3,luabind::detail::null_type>,luabind::detail::null_type>
1>          ]
1>          c:\src\kernel\TestOutPolicy.cpp(64) : see reference to
function template instantiation 'luabind::class_<T>
&luabind::class_<T>::def<void(__thiscall TestOutPolicy::* )(const
std::string &,std::string
&),luabind::detail::policy_cons<H,luabind::detail::null_type>>(const char
*,F,DefaultOrPolicies)' being compiled
1>          with
1>          [
1>              T=TestOutPolicy,
1>             
H=luabind::detail::out_value_policy<3,luabind::detail::null_type>,
1>              F=void (__thiscall TestOutPolicy::* )(const std::string
&,std::string &),
1>             
DefaultOrPolicies=luabind::detail::policy_cons<luabind::detail::out_value_policy<3,luabind::detail::null_type>,luabind::detail::null_type>
1>          ]
1>c:\3rdparty\lua\luabind-0.9\luabind\out_value_policy.hpp(78): error
C2784: 'luabind::detail::char_array<sizeof(identity<T>::type)>
luabind::detail::indirect_sizeof_test(luabind::detail::by_const_pointer<T>)'
: could not deduce template argument for
'luabind::detail::by_const_pointer<T>' from
'luabind::detail::by_reference<T>'
1>          with
1>          [
1>              T=std::string
1>          ]
1>          c:\3rdparty\lua\luabind-0.9\luabind\out_value_policy.hpp(68) :
see declaration of 'luabind::detail::indirect_sizeof_test'




------------------------------------------------------------------------------
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.