4 static void convert(lua_State
* L
, const boost::any
& a
)
6 typename
luabind::detail::default_converter::template generate_converter
<T
>::type conv
;
7 conv
.apply(any_cast
<T
>(&a
));
11 std::map
<const std::type_info
*, void(*)(const boost::any
&)> any_converters
;
14 void register_any_converter()
16 any_converters
[&typeid(T
)] = convert_any
<T
>::convert
;
23 yes_t
is_user_defined(by_value
<boost::any
>);
24 yes_t
is_user_defined(by_const_reference
<boost::any
>);
26 void convert_cpp_to_lua(lua_State
* L
, const boost::any
& a
)
28 typedef void(*conv_t
)(const boost::any
&);
29 conv_t conv
= any_converters
[&a
.type()];
42 register_any_converter
<int>();
43 register_any_converter
<float>();
44 register_any_converter
<const char*>();
45 register_any_converter
<std::string
>();
46 register_any_converter
<boost::intrusive_ptr
<Actor
> >();
48 lua_State
* L
= lua_open();