Skip to content
Snippets Groups Projects
Commit 7c76f2a7 authored by Ansgar Burchardt's avatar Ansgar Burchardt
Browse files

stop using deprecated `std::binary_function`

Just provide the type aliases directly and mark them deprecated
following similar deprecations in C++17.

Closes: #167
parent 2e9fde4d
Branches
Tags
1 merge request!685stop using `std::binary_function`
......@@ -4,18 +4,22 @@
#define DUNE_BINARYFUNCTIONS_HH
/** \file
* \brief Various helper classes derived from from std::binary_function for
* stl-style functional programming
* \brief helper classes to provide unique types for standard functions
*/
#include <functional>
#include <algorithm>
namespace Dune
{
template<typename Type>
struct Min
: std::binary_function<Type,Type,Type>
{
using first_argument_type [[deprecated("This type alias is deprecated following similar deprecations in C++17")]] = Type;
using second_argument_type [[deprecated("This type alias is deprecated following similar deprecations in C++17")]] = Type;
using result_type [[deprecated("This type alias is deprecated following similar deprecations in C++17")]] = Type;
Type operator()(const Type& t1, const Type& t2) const
{
return std::min(t1,t2);
......@@ -24,8 +28,13 @@ namespace Dune
template<typename Type>
struct Max
: std::binary_function<Type,Type,Type>
{
using first_argument_type [[deprecated("This type alias is deprecated following similar deprecations in C++17")]] = Type;
using second_argument_type [[deprecated("This type alias is deprecated following similar deprecations in C++17")]] = Type;
using result_type [[deprecated("This type alias is deprecated following similar deprecations in C++17")]] = Type;
Type operator()(const Type& t1, const Type& t2) const
{
return std::max(t1,t2);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment