Bonjour

J'ai une erreur que je ne comprend pas en compilant un code bindant une classe template sous luabind...

Je suis sous Visual Studio 2012 update4

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// Create a new lua state
	lua_State *myLuaState = luaL_newstate();
 
	// Connect LuaBind to this lua state
	luabind::open(myLuaState);
 
	// Export our classes with LuaBind
	luabind::module(myLuaState) [
	luabind::class_< Point<float> >("Point")
		.def(luabind::constructor<float, float>())
		.def_readwrite("X", &Point<float>::X)
		.def_readwrite("Y", &Point<float>::Y)
	];
 
	luabind::module(myLuaState) [
	luabind::class_< Box<float> >("Box")
		.def(luabind::constructor< Point<float>, Point<float> >())
		.def_readwrite("UpperLeft", &Box< Point<float> >::UpperLeft)
		.def_readwrite("LowerRight", &Box< Point<float> >::LowerRight)
	];
 
	lua_close(myLuaState);
L'erreur est:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
luabind/detail/call.hpp(294): error C2664: 'result_type luabind::detail::access_member_ptr<Class,T,Result>::operator ()(const Class &) const' : impossible de convertir le paramètre 1 de 'const Box<T>' en 'const Box<T> &'
1>          with
1>          [
1>              Class=Box<Point<float>>,
1>              T=Point<Point<float>>,
1>              Result=result_type
1>          ]
1>          and
1>          [
1>              T=float
1>          ]
1>          and
1>          [
1>              T=Point<float>
1>          ]
1>          Raison : impossible de convertir de 'const Box<T>' en 'const Box<T>'
1>          with
1>          [
1>              T=float
1>          ]
1>          and
1>          [
1>              T=Point<float>
1>          ]
1>          Aucun opérateur de conversion définie par l'utilisateur disponible qui puisse effectuer cette conversion, ou l'opérateur ne peut pas être appelé
1>          luabind/detail/call.hpp(89) : voir la référence à l'instanciation de la fonction modèle 'int luabind::detail::invoke_normal<F,boost::mpl::vector2<T0,T1>,Policies>(lua_State *,const luabind::detail::function_object &,luabind::detail::invoke_context &,const F &,Signature,const Policies &,boost::mpl::long_<N>,boost::mpl::false_)' en cours de compilation
1>          with
1>          [
1>              F=luabind::detail::access_member_ptr<Box<Point<float>>,Point<Point<float>>,result_type>,
1>              T0=result_type,
1>              T1=const Box<float> &,
1>              Policies=luabind::detail::policy_cons<luabind::detail::dependency_policy<0,1>,luabind::detail::null_type>,
1>              Signature=boost::mpl::vector2<result_type,const Box<float> &>,
1>              N=1
1>          ]
1>          luabind/detail/call.hpp(101) : voir la référence à l'instanciation de la fonction modèle 'int luabind::detail::invoke0<F,boost::mpl::vector2<T0,T1>,Policies,boost::is_void<T>>(lua_State *,const luabind::detail::function_object &,luabind::detail::invoke_context &,const F &,Signature,const Policies &,IsVoid,boost::mpl::false_)' en cours de compilation
1>          with
1>          [
1>              F=luabind::detail::access_member_ptr<Box<Point<float>>,Point<Point<float>>,result_type>,
1>              T0=result_type,
1>              T1=const Box<float> &,
1>              Policies=luabind::detail::policy_cons<luabind::detail::dependency_policy<0,1>,luabind::detail::null_type>,
1>              T=Point<Point<float>> &,
1>              Signature=boost::mpl::vector2<result_type,const Box<float> &>,
1>              IsVoid=boost::is_void<Point<Point<float>> &>
1>          ]
1>          luabind/make_function.hpp(41) : voir la référence à l'instanciation de la fonction modèle 'int luabind::detail::invoke<F,boost::mpl::vector2<T0,T1>,Policies>(lua_State *,const luabind::detail::function_object &,luabind::detail::invoke_context &,const F &,Signature,const Policies &)' en cours de compilation
1>          with
1>          [
1>              F=luabind::detail::access_member_ptr<Box<Point<float>>,Point<Point<float>>,result_type>,
1>              T0=result_type,
1>              T1=const Box<float> &,
1>              Policies=luabind::detail::policy_cons<luabind::detail::dependency_policy<0,1>,luabind::detail::null_type>,
1>              Signature=boost::mpl::vector2<result_type,const Box<float> &>
1>          ]
1>          luabind/make_function.hpp(40) : lors de la compilation de la fonction membre 'int luabind::detail::function_object_impl<F,Signature,Policies>::call(lua_State *,luabind::detail::invoke_context &) const' de la classe modèle
1>          with
1>          [
1>              F=luabind::detail::access_member_ptr<Box<Point<float>>,Point<Point<float>>,result_type>,
1>              Signature=boost::mpl::vector2<result_type,const Box<float> &>,
1>              Policies=luabind::detail::policy_cons<luabind::detail::dependency_policy<0,1>,luabind::detail::null_type>
1>          ]
1>          luabind/make_function.hpp(108) : voir la référence à l'instanciation de la classe modèle 'luabind::detail::function_object_impl<F,Signature,Policies>' en cours de compilation
1>          with
1>          [
1>              F=luabind::detail::access_member_ptr<Box<Point<float>>,Point<Point<float>>,result_type>,
1>              Signature=boost::mpl::vector2<result_type,const Box<float> &>,
1>              Policies=luabind::detail::policy_cons<luabind::detail::dependency_policy<0,1>,luabind::detail::null_type>
1>          ]
1>          luabind/class.hpp(437) : voir la référence à l'instanciation de la fonction modèle 'luabind::adl::object luabind::make_function<luabind::detail::access_member_ptr<Class,T,Result>,boost::mpl::vector2<T0,T1>,luabind::detail::policy_cons<H,Policies>>(lua_State *,F,Signature,luabind::detail::policy_cons<H,Policies>)' en cours de compilation
1>          with
1>          [
1>              Class=Box<Point<float>>,
1>              T=Point<Point<float>>,
1>              Result=result_type,
1>              T0=result_type,
1>              T1=const Box<float> &,
1>              H=luabind::detail::dependency_policy<0,1>,
1>              Policies=luabind::detail::null_type,
1>              F=luabind::detail::access_member_ptr<Box<Point<float>>,Point<Point<float>>,result_type>,
1>              Signature=boost::mpl::vector2<result_type,const Box<float> &>
1>          ]
1>          luabind/class.hpp(413) : voir la référence à l'instanciation de la fonction modèle 'luabind::adl::object luabind::detail::property_registration<Class,Get,GetPolicies,Set>::make_get<Box<T>,D>(lua_State *,D Box<T>::* ,boost::mpl::true_) const' en cours de compilation
1>          with
1>          [
1>              Class=Box<float>,
1>              Get=Point<Point<float>> Box<Point<float>>::* ,
1>              GetPolicies=luabind::detail::null_type,
1>              Set=Point<Point<float>> Box<Point<float>>::* ,
1>              T=Point<float>,
1>              D=Point<Point<float>>
1>          ]
1>          luabind/class.hpp(415) : voir la référence à l'instanciation de la fonction modèle 'luabind::adl::object luabind::detail::property_registration<Class,Get,GetPolicies,Set>::make_get<Box<T>,D>(lua_State *,D Box<T>::* ,boost::mpl::true_) const' en cours de compilation
1>          with
1>          [
1>              Class=Box<float>,
1>              Get=Point<Point<float>> Box<Point<float>>::* ,
1>              GetPolicies=luabind::detail::null_type,
1>              Set=Point<Point<float>> Box<Point<float>>::* ,
1>              T=Point<float>,
1>              D=Point<Point<float>>
1>          ]
1>          luabind/class.hpp(408) : lors de la compilation de la fonction membre 'void luabind::detail::property_registration<Class,Get,GetPolicies,Set>::register_(lua_State *) const' de la classe modèle
1>          with
1>          [
1>              Class=Box<float>,
1>              Get=Point<Point<float>> Box<Point<float>>::* ,
1>              GetPolicies=luabind::detail::null_type,
1>              Set=Point<Point<float>> Box<Point<float>>::* 
1>          ]
1>          luabind/class.hpp(684) : voir la référence à l'instanciation de la classe modèle 'luabind::detail::property_registration<Class,Get,GetPolicies,Set>' en cours de compilation
1>          with
1>          [
1>              Class=Box<float>,
1>              Get=Point<Point<float>> Box<Point<float>>::* ,
1>              GetPolicies=luabind::detail::null_type,
1>              Set=Point<Point<float>> Box<Point<float>>::* 
1>          ]
1>          main.cpp(497) : voir la référence à l'instanciation de la fonction modèle 'luabind::class_<T> &luabind::class_<T>::def_readwrite<Box<Point<float>>,Point<Point<float>>>(const char *,D Box<Point<float>>::* )' en cours de compilation
1>          with
1>          [
1>              T=Box<float>,
1>              D=Point<Point<float>>
1>          ]
1>          main.cpp(499) : voir la référence à l'instanciation de la fonction modèle 'luabind::class_<T> &luabind::class_<T>::def_readwrite<Box<Point<float>>,Point<Point<float>>>(const char *,D Box<Point<float>>::* )' en cours de compilation
1>          with
1>          [
1>              T=Box<float>,
1>              D=Point<Point<float>>
1>          ]
1>luabind/detail/call.hpp(298): error C2780: 'T &luabind::detail::ref_converter::apply(lua_State *,luabind::detail::by_reference<T>,int)' : 3 arguments attendus - 2 fournis
si quelqu'un a une idée, je suis preneur !
Merci

Résolu:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
luabind::class_< Box<float> >("Box")
		.def(luabind::constructor< Point<float>, Point<float> >())
		.def_readwrite("UpperLeft", &Box<float>::UpperLeft)
		.def_readwrite("LowerRight", &Box<float>::LowerRight)
	];