summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDaniel Robertson <danlrobertson89@gmail.com>2015-08-11 20:31:51 -0400
committerDavid Tardon <dtardon@redhat.com>2015-08-13 05:34:33 +0000
commit3babca3e849e1cb42225ca1c26e8f6156ad153e6 (patch)
tree9ceea495b6261e8f589f3432183a2f3553b4d827 /include
parentca6c2bab8771a209fde937599bf9cecea2b77104 (diff)
tdf#92459 basebmp: replace project2nd
Replace the use of project2nd in basebmp with a specialized functor similar to what is seen in paletteformats.hxx and pixelformatadapters.hxx. There should be no side effects due to this change. Change-Id: I1bbd723931e41986542e92bac773bbea68cfe5bd Reviewed-on: https://gerrit.libreoffice.org/17660 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: David Tardon <dtardon@redhat.com> Tested-by: David Tardon <dtardon@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/basebmp/accessortraits.hxx14
-rw-r--r--include/o3tl/compat_functional.hxx9
2 files changed, 10 insertions, 13 deletions
diff --git a/include/basebmp/accessortraits.hxx b/include/basebmp/accessortraits.hxx
index eeabae077f6b..d09f80559641 100644
--- a/include/basebmp/accessortraits.hxx
+++ b/include/basebmp/accessortraits.hxx
@@ -24,8 +24,6 @@
#include <basebmp/accessoradapters.hxx>
#include <basebmp/metafunctions.hxx>
-#include <o3tl/compat_functional.hxx>
-
#include <functional>
namespace basebmp
@@ -71,7 +69,15 @@ template< class Accessor,
type;
};
-
+/// given an Accessor and its value type return its value_type
+template< typename Accessor > struct ColorPassThrough
+{
+ typename Accessor::value_type operator()( const Accessor&,
+ const typename Accessor::value_type& x ) const
+ {
+ return x;
+ }
+};
/** Traits template for Accessor
@@ -84,7 +90,7 @@ template< class Accessor > struct AccessorTraits
typedef typename Accessor::value_type value_type;
/// Retrieve stand-alone color lookup function for given Accessor type
- typedef o3tl::project2nd< Accessor, value_type > color_lookup;
+ typedef ColorPassThrough< Accessor > color_lookup;
/// Retrieve raw pixel data accessor for given Accessor type
typedef Accessor raw_accessor;
diff --git a/include/o3tl/compat_functional.hxx b/include/o3tl/compat_functional.hxx
index fa6fbd57d845..522056740e9f 100644
--- a/include/o3tl/compat_functional.hxx
+++ b/include/o3tl/compat_functional.hxx
@@ -37,15 +37,6 @@
namespace o3tl
{
-// 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 {
- return x;
- }
-};
-
/// Select first value of a pair
template<typename P>
struct select1st