diff --git a/include/chaiscript/dispatchkit/bootstrap_stl.hpp b/include/chaiscript/dispatchkit/bootstrap_stl.hpp index 2408309..d57a2a7 100644 --- a/include/chaiscript/dispatchkit/bootstrap_stl.hpp +++ b/include/chaiscript/dispatchkit/bootstrap_stl.hpp @@ -203,10 +203,10 @@ namespace chaiscript { assignable_type(type, m); - m->add(fun(&ContainerType::size), "size"); - m->add(fun(&ContainerType::max_size), "max_size"); - m->add(fun(&ContainerType::empty), "empty"); - m->add(fun(&ContainerType::clear), "clear"); + m->add(fun(&ContainerType::size), "size"); + m->add(fun(&ContainerType::max_size), "max_size"); + m->add(fun(&ContainerType::empty), "empty"); + m->add(fun(&ContainerType::clear), "clear"); return m; } @@ -387,7 +387,7 @@ namespace chaiscript ModulePtr unique_associative_container_type(const std::string &type, ModulePtr m = ModulePtr(new Module())) { associative_container_type(type, m); - m->add(fun(&ContainerType::count), "count"); + m->add(fun(&ContainerType::count), "count"); return m; } diff --git a/include/chaiscript/dispatchkit/register_function.hpp b/include/chaiscript/dispatchkit/register_function.hpp index c628eea..9fd7e31 100644 --- a/include/chaiscript/dispatchkit/register_function.hpp +++ b/include/chaiscript/dispatchkit/register_function.hpp @@ -17,11 +17,18 @@ namespace chaiscript { template - Proxy_Function fun(const boost::function &f) + Proxy_Function fun(T t) + { + return fun_helper(t); + } + + template + Proxy_Function fun_helper(const boost::function &f) { return Proxy_Function(new Proxy_Function_Impl(f)); } + namespace detail { /** @@ -40,9 +47,9 @@ namespace chaiscript * for example, the case of std::pair<>::first and std::pair<>::second */ template - Proxy_Function fun(T Class::* m) + Proxy_Function fun_helper(T Class::* m) { - return fun(boost::function(boost::bind(&detail::get_member, m, _1))); + return fun_helper(boost::function(boost::bind(&detail::get_member, m, _1))); } } @@ -61,27 +68,27 @@ namespace chaiscript * Register a global function of n parameters with name */ template - Proxy_Function fun(Ret (*f)(BOOST_PP_ENUM_PARAMS(n, Param))) + Proxy_Function fun_helper(Ret (*f)(BOOST_PP_ENUM_PARAMS(n, Param))) { - return fun(boost::function(f)); + return fun_helper(boost::function(f)); } /** * Register a class method of n parameters with name */ template - Proxy_Function fun(Ret (Class::*f)(BOOST_PP_ENUM_PARAMS(n, Param))) + Proxy_Function fun_helper(Ret (Class::*f)(BOOST_PP_ENUM_PARAMS(n, Param))) { - return fun(boost::function(f)); + return fun_helper(boost::function(f)); } /** * Register a const class method of n parameters with name */ template - Proxy_Function fun(Ret (Class::*f)(BOOST_PP_ENUM_PARAMS(n, Param))const) + Proxy_Function fun_helper(Ret (Class::*f)(BOOST_PP_ENUM_PARAMS(n, Param))const) { - return fun(boost::function(f)); + return fun_helper(boost::function(f)); } } diff --git a/msvc/chaiscript/chaiscript.vcproj b/msvc/chaiscript/chaiscript.vcproj index 9fe6172..4c185d7 100644 --- a/msvc/chaiscript/chaiscript.vcproj +++ b/msvc/chaiscript/chaiscript.vcproj @@ -122,7 +122,7 @@ Name="VCCLCompilerTool" Optimization="3" EnableIntrinsicFunctions="true" - AdditionalIncludeDirectories=""$(ProjectDir)\..\..\dispatchkit";"$(ProjectDir)\..\..\chaiscript"" + AdditionalIncludeDirectories=""$(ProjectDir)\..\..\include"" PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE" RuntimeLibrary="2" EnableFunctionLevelLinking="true" @@ -229,6 +229,14 @@ RelativePath="..\..\include\chaiscript\dispatchkit\function_call.hpp" > + + + + @@ -237,6 +245,10 @@ RelativePath="..\..\include\chaiscript\dispatchkit\proxy_functions.hpp" > + +