2013-02-11 70 views
1

我遇到了一些問題讓Luabind使用函數的'pure_out_value'屬性。就我而言,Luabind在編譯期間出錯,說模板不包含使用該屬性所需的特定函數。Luabind pure_out_value拒絕編譯

正在使用的代碼是非常相似的一個在test_policies.cpp附帶Luabind:

class IConfiguration 
{ 
    int GetString(const char* className, const char* entryName, char** ppszOut); 
}; 

module(L) 
[ 
    class_<IConfiguration>("IConfiguration") 
     .def("GetString", &IConfiguration::GetString, pure_out_value(_3)) 
]; 

我得到的,當我嘗試編譯此的誤差:

'apply' : is not a member of 'luabind::detail::pure_out_value_policy<N,Policies>::only_accepts_nonconst_references_or_pointers' 
'consumed_args' : is not a member of 'luabind::detail::pure_out_value_policy<N,Policies>::only_accepts_nonconst_references_or_pointers' 
'consumed_args' : is not a member of 'luabind::detail::pure_out_value_policy<N,Policies>::only_accepts_nonconst_references_or_pointers' 
'converter_postcall' : is not a member of 'luabind::detail::pure_out_value_policy<N,Policies>::only_accepts_nonconst_references_or_pointers' 
'match' : is not a member of 'luabind::detail::pure_out_value_policy<N,Policies>::only_accepts_nonconst_references_or_pointers' 

相關信息到環境:

  • Lua 5.1.4(帶按位補丁)
  • Luabind 0.9.1
  • 升壓1.53
  • 的Visual Studio 2012 W /更新1(與v110_xp設置編譯)

我也試圖與Luabind的公知的補丁版本爲5.2(仍支持5.1太),它可以在這裏找到: https://bitbucket.org/cinderblocks/luabind

Luabind其餘似乎做工精細,只是沒有pure_out_value政策雖然。

回答

1

當然,在發佈求助信息後,我發現了這個問題。當發生這種情況時的愛..

對於類似問題的任何人,問題是與我用pure_out_value使用的參數編號。在我上面的例子中,由於參數是類成員函數的一部分,我忘了解釋自動發生的'this'參數。所以,而不是_3它應該是_4。

現在的偉大工程。 :)

相關問題