Various cleanups prefering lambda to bind

This commit is contained in:
Jason Turner
2014-09-14 21:53:11 -06:00
parent f02a9fa885
commit 6c2ccf3869
4 changed files with 25 additions and 43 deletions

View File

@@ -53,29 +53,6 @@ namespace chaiscript
{
namespace detail
{
template<typename ... Rest>
struct Build_Param_Type_List;
template<typename Param, typename ... Rest>
struct Build_Param_Type_List<Param, Rest...>
{
static void build(std::vector<Type_Info> &t_params)
{
t_params.push_back(chaiscript::detail::Get_Type_Info<Param>::get());
Build_Param_Type_List<Rest...>::build(t_params);
}
};
// 0th case
template<>
struct Build_Param_Type_List<>
{
static void build(std::vector<Type_Info> &)
{
}
};
/**
* Used by Proxy_Function_Impl to return a list of all param types
* it contains.
@@ -83,12 +60,8 @@ namespace chaiscript
template<typename Ret, typename ... Params>
std::vector<Type_Info> build_param_type_list(Ret (*)(Params...))
{
/// \todo this code was previously using { chaiscript::detail::Get_Type_Info<Ret>::get()... }
/// but this seems to indicate another bug with MSVC's uniform initializer lists
std::vector<Type_Info> params;
params.push_back(chaiscript::detail::Get_Type_Info<Ret>::get());
Build_Param_Type_List<Params...>::build(params);
return params;
/// \note somehow this is responsible for a large part of the code generation
return { user_type<Ret>(), user_type<Params>()... };
}