summaryrefslogtreecommitdiff
path: root/boost/accumulators/numeric/functional.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'boost/accumulators/numeric/functional.hpp')
-rw-r--r--boost/accumulators/numeric/functional.hpp52
1 files changed, 34 insertions, 18 deletions
diff --git a/boost/accumulators/numeric/functional.hpp b/boost/accumulators/numeric/functional.hpp
index d5d79f5c49..858decc199 100644
--- a/boost/accumulators/numeric/functional.hpp
+++ b/boost/accumulators/numeric/functional.hpp
@@ -99,11 +99,9 @@ namespace boost { namespace numeric
}; \
template<typename Arg, typename EnableIf> \
struct Name ## _base \
- : std::unary_function< \
- typename remove_const<Arg>::type \
- , typename result_of_ ## Name<Arg>::type \
- > \
{ \
+ typedef typename remove_const<Arg>::type argument_type; \
+ typedef typename result_of_ ## Name<Arg>::type result_type; \
typename result_of_ ## Name<Arg>::type operator ()(Arg &arg) const \
{ \
return Op arg; \
@@ -138,12 +136,10 @@ namespace boost { namespace numeric
}; \
template<typename Left, typename Right, typename EnableIf> \
struct Name ## _base \
- : std::binary_function< \
- typename remove_const<Left>::type \
- , typename remove_const<Right>::type \
- , typename result_of_ ## Name<Left, Right>::type \
- > \
{ \
+ typedef typename remove_const<Left>::type first_argument_type; \
+ typedef typename remove_const<Right>::type second_argument_type; \
+ typedef typename result_of_ ## Name<Left, Right>::type result_type; \
typename result_of_ ## Name<Left, Right>::type \
operator ()(Left &left, Right &right) const \
{ \
@@ -220,8 +216,11 @@ namespace boost { namespace numeric
{
template<typename Left, typename Right, typename EnableIf>
struct min_assign_base
- : std::binary_function<Left, Right, void>
{
+ typedef Left first_argument_type;
+ typedef Right second_argument_type;
+ typedef void result_type;
+
void operator ()(Left &left, Right &right) const
{
if(numeric::less(right, left))
@@ -233,8 +232,11 @@ namespace boost { namespace numeric
template<typename Left, typename Right, typename EnableIf>
struct max_assign_base
- : std::binary_function<Left, Right, void>
{
+ typedef Left first_argument_type;
+ typedef Right second_argument_type;
+ typedef void result_type;
+
void operator ()(Left &left, Right &right) const
{
if(numeric::greater(right, left))
@@ -258,8 +260,10 @@ namespace boost { namespace numeric
template<typename To, typename From, typename EnableIf>
struct promote_base
- : std::unary_function<From, To>
{
+ typedef From argument_type;
+ typedef To result_type;
+
To operator ()(From &from) const
{
return from;
@@ -268,8 +272,10 @@ namespace boost { namespace numeric
template<typename ToFrom>
struct promote_base<ToFrom, ToFrom, void>
- : std::unary_function<ToFrom, ToFrom>
{
+ typedef ToFrom argument_type;
+ typedef ToFrom result_type;
+
ToFrom &operator ()(ToFrom &tofrom)
{
return tofrom;
@@ -278,10 +284,12 @@ namespace boost { namespace numeric
template<typename Arg, typename EnableIf>
struct as_min_base
- : std::unary_function<Arg, typename remove_const<Arg>::type>
{
BOOST_STATIC_ASSERT(std::numeric_limits<typename remove_const<Arg>::type>::is_specialized);
+ typedef Arg argument_type;
+ typedef typename remove_const<Arg>::type result_type;
+
typename remove_const<Arg>::type operator ()(Arg &) const
{
return (std::numeric_limits<typename remove_const<Arg>::type>::min)();
@@ -290,10 +298,12 @@ namespace boost { namespace numeric
template<typename Arg>
struct as_min_base<Arg, typename enable_if<is_floating_point<Arg> >::type>
- : std::unary_function<Arg, typename remove_const<Arg>::type>
{
BOOST_STATIC_ASSERT(std::numeric_limits<typename remove_const<Arg>::type>::is_specialized);
+ typedef Arg argument_type;
+ typedef typename remove_const<Arg>::type result_type;
+
typename remove_const<Arg>::type operator ()(Arg &) const
{
return -(std::numeric_limits<typename remove_const<Arg>::type>::max)();
@@ -302,10 +312,12 @@ namespace boost { namespace numeric
template<typename Arg, typename EnableIf>
struct as_max_base
- : std::unary_function<Arg, typename remove_const<Arg>::type>
{
BOOST_STATIC_ASSERT(std::numeric_limits<typename remove_const<Arg>::type>::is_specialized);
+ typedef Arg argument_type;
+ typedef typename remove_const<Arg>::type result_type;
+
typename remove_const<Arg>::type operator ()(Arg &) const
{
return (std::numeric_limits<typename remove_const<Arg>::type>::max)();
@@ -314,8 +326,10 @@ namespace boost { namespace numeric
template<typename Arg, typename EnableIf>
struct as_zero_base
- : std::unary_function<Arg, typename remove_const<Arg>::type>
{
+ typedef Arg argument_type;
+ typedef typename remove_const<Arg>::type result_type;
+
typename remove_const<Arg>::type operator ()(Arg &) const
{
return numeric::zero<typename remove_const<Arg>::type>::value;
@@ -324,8 +338,10 @@ namespace boost { namespace numeric
template<typename Arg, typename EnableIf>
struct as_one_base
- : std::unary_function<Arg, typename remove_const<Arg>::type>
{
+ typedef Arg argument_type;
+ typedef typename remove_const<Arg>::type result_type;
+
typename remove_const<Arg>::type operator ()(Arg &) const
{
return numeric::one<typename remove_const<Arg>::type>::value;