From f4080c4c759b07a8fecd01ad5aa7c3fe67279822 Mon Sep 17 00:00:00 2001 From: Jason Turner Date: Sat, 10 Sep 2011 14:01:05 -0600 Subject: [PATCH] Move from boost::mem_fn to std::mem_fn --- include/chaiscript/dispatchkit/bind_first.hpp | 4 ++-- .../chaiscript/dispatchkit/bootstrap_stl.hpp | 20 +++++++++---------- .../dispatchkit/register_function.hpp | 2 +- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/include/chaiscript/dispatchkit/bind_first.hpp b/include/chaiscript/dispatchkit/bind_first.hpp index f506439..2792724 100644 --- a/include/chaiscript/dispatchkit/bind_first.hpp +++ b/include/chaiscript/dispatchkit/bind_first.hpp @@ -39,7 +39,7 @@ namespace chaiscript std::function bind_first(Ret (Class::*f)(BOOST_PP_ENUM_PARAMS(n, Param)), const O &o) { - return std::bind(boost::mem_fn(f), o BOOST_PP_COMMA_IF(n) BOOST_PP_ENUM(n, param, std::placeholders::_)); + return std::bind(std::mem_fn(f), o BOOST_PP_COMMA_IF(n) BOOST_PP_ENUM(n, param, std::placeholders::_)); } /// \brief Helper function for binding the first parameter of a const class method pointer. Used in chaiscript::fun overloads @@ -52,7 +52,7 @@ namespace chaiscript std::function bind_first(Ret (Class::*f)(BOOST_PP_ENUM_PARAMS(n, Param)) const, const O &o) { - return std::bind(boost::mem_fn(f), o BOOST_PP_COMMA_IF(n) BOOST_PP_ENUM(n, param, std::placeholders::_)); + return std::bind(std::mem_fn(f), o BOOST_PP_COMMA_IF(n) BOOST_PP_ENUM(n, param, std::placeholders::_)); } /// \brief Helper function for binding the first parameter of a function pointer. Used in chaiscript::fun overloads diff --git a/include/chaiscript/dispatchkit/bootstrap_stl.hpp b/include/chaiscript/dispatchkit/bootstrap_stl.hpp index 0bb93b6..a98534a 100644 --- a/include/chaiscript/dispatchkit/bootstrap_stl.hpp +++ b/include/chaiscript/dispatchkit/bootstrap_stl.hpp @@ -228,10 +228,10 @@ namespace chaiscript //to throw an exception in an out of bounds condition. m->add( fun(std::function - (boost::mem_fn(static_cast(&ContainerType::at)))), "[]"); + (std::mem_fn(static_cast(&ContainerType::at)))), "[]"); m->add( fun(std::function - (boost::mem_fn(static_cast(&ContainerType::at)))), "[]"); + (std::mem_fn(static_cast(&ContainerType::at)))), "[]"); return m; } @@ -255,7 +255,7 @@ namespace chaiscript template ModulePtr container_type(const std::string &/*type*/, ModulePtr m = ModulePtr(new Module())) { - m->add(fun(std::function(boost::mem_fn(&ContainerType::size))), "size"); + m->add(fun(std::function(std::mem_fn(&ContainerType::size))), "size"); m->add(fun(&ContainerType::empty), "empty"); m->add(fun(&ContainerType::clear), "clear"); @@ -390,7 +390,7 @@ namespace chaiscript template ModulePtr unique_associative_container_type(const std::string &/*type*/, ModulePtr m = ModulePtr(new Module())) { - m->add(fun(std::function(boost::mem_fn(&ContainerType::count))), "count"); + m->add(fun(std::function(std::mem_fn(&ContainerType::count))), "count"); return m; } @@ -515,12 +515,12 @@ namespace chaiscript typedef std::function find_func; - m->add(fun(find_func(boost::mem_fn(static_cast(&String::find)))), "find"); - m->add(fun(find_func(boost::mem_fn(static_cast(&String::rfind)))), "rfind"); - m->add(fun(find_func(boost::mem_fn(static_cast(&String::find_first_of)))), "find_first_of"); - m->add(fun(find_func(boost::mem_fn(static_cast(&String::find_last_of)))), "find_last_of"); - m->add(fun(find_func(boost::mem_fn(static_cast(&String::find_first_not_of)))), "find_first_not_of"); - m->add(fun(find_func(boost::mem_fn(static_cast(&String::find_last_not_of)))), "find_last_not_of"); + m->add(fun(find_func(std::mem_fn(static_cast(&String::find)))), "find"); + m->add(fun(find_func(std::mem_fn(static_cast(&String::rfind)))), "rfind"); + m->add(fun(find_func(std::mem_fn(static_cast(&String::find_first_of)))), "find_first_of"); + m->add(fun(find_func(std::mem_fn(static_cast(&String::find_last_of)))), "find_last_of"); + m->add(fun(find_func(std::mem_fn(static_cast(&String::find_first_not_of)))), "find_first_not_of"); + m->add(fun(find_func(std::mem_fn(static_cast(&String::find_last_not_of)))), "find_last_not_of"); m->add(fun(&String::c_str), "c_str"); m->add(fun(&String::data), "data"); diff --git a/include/chaiscript/dispatchkit/register_function.hpp b/include/chaiscript/dispatchkit/register_function.hpp index 8d7efae..e62064a 100644 --- a/include/chaiscript/dispatchkit/register_function.hpp +++ b/include/chaiscript/dispatchkit/register_function.hpp @@ -44,7 +44,7 @@ namespace chaiscript typename boost::function_types::function_type >::type> ( std::function< typename boost::function_types::function_type >::type - >(boost::mem_fn(t)))); + >(std::mem_fn(t)))); } };