Kaydet (Commit) ae6afadb authored tarafından Daniel Robertson's avatar Daniel Robertson Kaydeden (comit) Thorsten Behrens

tdf#92459 o3tl: remove unary_function

Clean up o3tl/compat_functional.hxx select1st/select2nd. Remove the
structs inheritance from the now deprecated unary_function. Remove
project1st, as it is not used.

Change-Id: I60c0f30c4b87417a331a4b38f62993cc3d1c9a51
Reviewed-on: https://gerrit.libreoffice.org/17625Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarThorsten Behrens <Thorsten.Behrens@CIB.de>
üst f6595f0b
......@@ -32,48 +32,39 @@
#ifndef INCLUDED_O3TL_COMPAT_FUNCTIONAL_HXX
#define INCLUDED_O3TL_COMPAT_FUNCTIONAL_HXX
#include <utility>
#include <functional>
namespace o3tl
{
/// Functor, given two parameters, return the first
template<class T1,class T2>
struct project1st : public std::binary_function<T1, T2, T1>
{
T1 operator()(const T1& y, const T2&) const
{
return y;
}
};
/// Functor, given two parameters, return the second
template<class T1,class T2>
// Functor, given two parameters, return the second
template<class T1, class T2>
struct project2nd : public std::binary_function<T1, T2, T2>
{
T2 operator()(const T1&, const T2& x) const
{
T2 operator()(const T1&, const T2& x) const {
return x;
}
};
/// Select first value of a pair
template<class P>
struct select1st : public std::unary_function<P, typename P::first_type>
template<typename P>
struct select1st
{
const typename P::first_type& operator()(const P& y) const
{
return y.first;
typedef P argument_type;
typedef typename P::first_type result_type;
const result_type& operator()( const argument_type& cp ) const {
return cp.first;
}
};
/// Select second value of a pair
template<class P>
struct select2nd : public std::unary_function<P, typename P::second_type>
template<typename P>
struct select2nd
{
const typename P::second_type& operator()(const P& y) const
{
return y.second;
typedef P argument_type;
typedef typename P::second_type result_type;
const result_type& operator()( const argument_type& cp ) const {
return cp.second;
}
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment