forked from boostorg/function
function_template.hpp:
- Use boost::mem_fn internally to deal with calls to unbound
member functions.
[SVN r11731]
This commit is contained in:
1 parent
a4c09a92d1
commit
cc3a33a19c
1 file changed
+4
-3
@@ -22,6 +22,7 @@
|
|||||||
# include <algorithm>
|
# include <algorithm>
|
||||||
# include <boost/config.hpp>
|
# include <boost/config.hpp>
|
||||||
# include <boost/function/function_base.hpp>
|
# include <boost/function/function_base.hpp>
|
||||||
|
# include <boost/mem_fn.hpp>
|
||||||
#endif // BOOST_FUNCTION_FUNCTION_TEMPLATE_HPP
|
#endif // BOOST_FUNCTION_FUNCTION_TEMPLATE_HPP
|
||||||
|
|
||||||
// Type of the default allocator
|
// Type of the default allocator
|
||||||
@@ -143,7 +144,7 @@ namespace boost {
|
|||||||
{
|
{
|
||||||
MemFunctionPtr f =
|
MemFunctionPtr f =
|
||||||
reinterpret_cast<MemFunctionPtr>(mem_function_ptr.mem_func_ptr);
|
reinterpret_cast<MemFunctionPtr>(mem_function_ptr.mem_func_ptr);
|
||||||
return ((*a0).*f)(BOOST_FUNCTION_NOT_0_ARGS);
|
return mem_fn(f)(BOOST_FUNCTION_ARGS);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -160,8 +161,8 @@ namespace boost {
|
|||||||
{
|
{
|
||||||
MemFunctionPtr f =
|
MemFunctionPtr f =
|
||||||
reinterpret_cast<MemFunctionPtr>(mem_function_ptr.mem_func_ptr);
|
reinterpret_cast<MemFunctionPtr>(mem_function_ptr.mem_func_ptr);
|
||||||
(a0->*f)(BOOST_FUNCTION_NOT_0_ARGS);
|
mem_fn(f)(BOOST_FUNCTION_ARGS);
|
||||||
return unusable();
|
return unusable();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
#endif // BOOST_FUNCTION_NUM_ARGS > 0
|
#endif // BOOST_FUNCTION_NUM_ARGS > 0
|
||||||
|
|||||||
Reference in new issue
Block a user