Move "fun_helper" into detail namespace

This commit is contained in:
Jason Turner 2009-08-09 19:12:01 +00:00
parent bc3a17b3b7
commit 00e4de774f

View File

@ -16,19 +16,6 @@
namespace chaiscript
{
template<typename T>
Proxy_Function fun(T t)
{
return fun_helper(t);
}
template<typename T>
Proxy_Function fun_helper(const boost::function<T> &f)
{
return Proxy_Function(new Proxy_Function_Impl<T>(f));
}
namespace detail
{
/**
@ -39,6 +26,11 @@ namespace chaiscript
{
return (obj->*m);
}
template<typename T>
Proxy_Function fun_helper(const boost::function<T> &f)
{
return Proxy_Function(new Proxy_Function_Impl<T>(f));
}
/**
@ -51,19 +43,31 @@ namespace chaiscript
{
return fun_helper(boost::function<T& (Class *)>(boost::bind(&detail::get_member<T, Class>, m, _1)));
}
}
}
#define BOOST_PP_ITERATION_LIMITS ( 0, 10 )
#define BOOST_PP_FILENAME_1 <chaiscript/dispatchkit/register_function.hpp>
#include BOOST_PP_ITERATE()
namespace chaiscript
{
template<typename T>
Proxy_Function fun(T t)
{
return detail::fun_helper(t);
}
}
# endif
#else
# define n BOOST_PP_ITERATION()
namespace chaiscript
{
namespace detail
{
/**
* Register a global function of n parameters with name
*/
@ -90,6 +94,8 @@ namespace chaiscript
{
return fun_helper(boost::function<Ret (const Class* BOOST_PP_COMMA_IF(n) BOOST_PP_ENUM_PARAMS(n, Param))>(f));
}
}
}
#endif