From 6b0b66c0f2d0df5fb98e473dfc38323cfb6be945 Mon Sep 17 00:00:00 2001 From: Samuel Debionne Date: Fri, 14 Dec 2018 22:58:55 +0100 Subject: [PATCH] Remove deprecated unary/binary_function (#191) std::unary_function and std::binary_function are deprecated in C++11 and removed in C++17. --- .../numeric/channel_numeric_operations.hpp | 24 +++++++++---------- .../numeric/pixel_numeric_operations.hpp | 2 -- 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/include/boost/gil/extension/numeric/channel_numeric_operations.hpp b/include/boost/gil/extension/numeric/channel_numeric_operations.hpp index 73942b38c..5356bd573 100644 --- a/include/boost/gil/extension/numeric/channel_numeric_operations.hpp +++ b/include/boost/gil/extension/numeric/channel_numeric_operations.hpp @@ -10,8 +10,6 @@ #include -#include - namespace boost { namespace gil { // Structures for channel-wise numeric operations @@ -26,7 +24,7 @@ namespace boost { namespace gil { /// structure for adding one channel to another /// this is a generic implementation; user should specialize it for better performance template -struct channel_plus_t : public std::binary_function { +struct channel_plus_t { ChannelR operator()(typename channel_traits::const_reference ch1, typename channel_traits::const_reference ch2) const { return ChannelR(ch1)+ChannelR(ch2); @@ -37,7 +35,7 @@ struct channel_plus_t : public std::binary_function /// structure for subtracting one channel from another /// this is a generic implementation; user should specialize it for better performance template -struct channel_minus_t : public std::binary_function { +struct channel_minus_t { ChannelR operator()(typename channel_traits::const_reference ch1, typename channel_traits::const_reference ch2) const { return ChannelR(ch1)-ChannelR(ch2); @@ -48,7 +46,7 @@ struct channel_minus_t : public std::binary_function /// structure for multiplying one channel to another /// this is a generic implementation; user should specialize it for better performance template -struct channel_multiplies_t : public std::binary_function { +struct channel_multiplies_t { ChannelR operator()(typename channel_traits::const_reference ch1, typename channel_traits::const_reference ch2) const { return ChannelR(ch1)*ChannelR(ch2); @@ -59,7 +57,7 @@ struct channel_multiplies_t : public std::binary_function -struct channel_divides_t : public std::binary_function { +struct channel_divides_t { ChannelR operator()(typename channel_traits::const_reference ch1, typename channel_traits::const_reference ch2) const { return ChannelR(ch1)/ChannelR(ch2); @@ -70,7 +68,7 @@ struct channel_divides_t : public std::binary_function -struct channel_plus_scalar_t : public std::binary_function { +struct channel_plus_scalar_t { ChannelR operator()(typename channel_traits::const_reference ch, const Scalar& s) const { return ChannelR(ch)+ChannelR(s); @@ -81,7 +79,7 @@ struct channel_plus_scalar_t : public std::binary_function -struct channel_minus_scalar_t : public std::binary_function { +struct channel_minus_scalar_t { ChannelR operator()(typename channel_traits::const_reference ch, const Scalar& s) const { return ChannelR(ch-s); @@ -92,7 +90,7 @@ struct channel_minus_scalar_t : public std::binary_function -struct channel_multiplies_scalar_t : public std::binary_function { +struct channel_multiplies_scalar_t { ChannelR operator()(typename channel_traits::const_reference ch, const Scalar& s) const { return ChannelR(ch)*ChannelR(s); @@ -103,7 +101,7 @@ struct channel_multiplies_scalar_t : public std::binary_function -struct channel_divides_scalar_t : public std::binary_function { +struct channel_divides_scalar_t { ChannelR operator()(typename channel_traits::const_reference ch, const Scalar& s) const { return ChannelR(ch)/ChannelR(s); @@ -114,7 +112,7 @@ struct channel_divides_scalar_t : public std::binary_function -struct channel_halves_t : public std::unary_function { +struct channel_halves_t { typename channel_traits::reference operator()(typename channel_traits::reference ch) const { return ch/=2.0; @@ -125,7 +123,7 @@ struct channel_halves_t : public std::unary_function { /// structure for setting a channel to zero /// this is a generic implementation; user should specialize it for better performance template -struct channel_zeros_t : public std::unary_function { +struct channel_zeros_t { typename channel_traits::reference operator()(typename channel_traits::reference ch) const { return ch=Channel(0); @@ -136,7 +134,7 @@ struct channel_zeros_t : public std::unary_function { /// structure for assigning one channel to another /// this is a generic implementation; user should specialize it for better performance template -struct channel_assigns_t : public std::binary_function { +struct channel_assigns_t { typename channel_traits::reference operator()(typename channel_traits::const_reference ch1, typename channel_traits::reference ch2) const { diff --git a/include/boost/gil/extension/numeric/pixel_numeric_operations.hpp b/include/boost/gil/extension/numeric/pixel_numeric_operations.hpp index cc055f39b..fc42eb5b4 100644 --- a/include/boost/gil/extension/numeric/pixel_numeric_operations.hpp +++ b/include/boost/gil/extension/numeric/pixel_numeric_operations.hpp @@ -13,8 +13,6 @@ #include #include -#include - namespace boost { namespace gil { // Structures for pixel-wise numeric operations