[libsigcplusplus] adapts, adaptor_functor: Remove result_type.
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libsigcplusplus] adapts, adaptor_functor: Remove result_type.
- Date: Wed, 13 Apr 2016 20:19:55 +0000 (UTC)
commit e3c79b706dd181c2f8f0e3c812759d7d8d3e183a
Author: Murray Cumming <murrayc murrayc com>
Date: Wed Apr 13 20:58:35 2016 +0200
adapts, adaptor_functor: Remove result_type.
Instead just using functor_trait<T_Functor>::result_type wherever
it would be used, because that is always the same thing.
sigc++/adaptors/adaptor_trait.h | 2 --
sigc++/adaptors/adapts.h | 1 -
sigc++/adaptors/bind.h | 11 ++---------
sigc++/adaptors/compose.h | 6 +-----
sigc++/adaptors/exception_catch.h | 2 +-
sigc++/adaptors/hide.h | 6 +-----
sigc++/adaptors/retype.h | 6 +-----
sigc++/adaptors/track_obj.h | 5 +----
8 files changed, 7 insertions(+), 32 deletions(-)
---
diff --git a/sigc++/adaptors/adaptor_trait.h b/sigc++/adaptors/adaptor_trait.h
index 90f9976..df56b29 100644
--- a/sigc++/adaptors/adaptor_trait.h
+++ b/sigc++/adaptors/adaptor_trait.h
@@ -65,8 +65,6 @@ namespace sigc
template <class T_functor>
struct adaptor_functor : public adaptor_base
{
- using result_type = typename functor_trait<T_functor>::result_type;
-
/** Invokes the wrapped functor passing on the arguments.
* @return The return value of the functor invocation.
*/
diff --git a/sigc++/adaptors/adapts.h b/sigc++/adaptors/adapts.h
index 4977c70..c7af3a6 100644
--- a/sigc++/adaptors/adapts.h
+++ b/sigc++/adaptors/adapts.h
@@ -76,7 +76,6 @@ namespace sigc
template <class T_functor>
struct adapts : public adaptor_base
{
- using result_type = typename functor_trait<T_functor>::result_type;
using adaptor_type = typename adaptor_trait<T_functor>::adaptor_type;
/** Constructs an adaptor that wraps the passed functor.
diff --git a/sigc++/adaptors/bind.h b/sigc++/adaptors/bind.h
index 9b2c98c..0d9a02c 100644
--- a/sigc++/adaptors/bind.h
+++ b/sigc++/adaptors/bind.h
@@ -107,11 +107,7 @@ struct TransformEachInvoker
template <int I_location, class T_functor, class... T_bound>
struct bind_functor : public adapts<T_functor>
{
-private:
- using adaptor_type = typename adapts<T_functor>::adaptor_type;
-
-public:
- using result_type = typename adaptor_type::result_type;
+ using result_type = typename functor_trait<T_functor>::result_type;
/** Invokes the wrapped functor passing on the arguments.
* bound_ is passed as the next argument.
@@ -170,11 +166,8 @@ private:
template <class T_functor, class... T_type>
struct bind_functor<-1, T_functor, T_type...> : public adapts<T_functor>
{
-private:
- using adaptor_type = typename adapts<T_functor>::adaptor_type;
-
public:
- using result_type = typename adaptor_type::result_type;
+ using result_type = typename functor_trait<T_functor>::result_type;
/** Invokes the wrapped functor passing on the arguments.
* bound_ is passed as the next argument.
diff --git a/sigc++/adaptors/compose.h b/sigc++/adaptors/compose.h
index 5c7aca9..2e5af90 100644
--- a/sigc++/adaptors/compose.h
+++ b/sigc++/adaptors/compose.h
@@ -43,13 +43,9 @@ namespace sigc
template <class T_setter, class T_getter>
struct compose1_functor : public adapts<T_setter>
{
-private:
- using adaptor_type = typename adapts<T_setter>::adaptor_type;
-
-public:
using setter_type = T_setter;
using getter_type = T_getter;
- using result_type = typename adaptor_type::result_type;
+ using result_type = typename functor_trait<T_setter>::result_type;
decltype(auto) operator()() { return this->functor_(get_()); }
diff --git a/sigc++/adaptors/exception_catch.h b/sigc++/adaptors/exception_catch.h
index 519e7cc..1bddd7c 100644
--- a/sigc++/adaptors/exception_catch.h
+++ b/sigc++/adaptors/exception_catch.h
@@ -56,7 +56,7 @@ namespace sigc
*/
template <class T_functor, class T_catcher,
- class T_return = typename adapts<T_functor>::result_type>
+ class T_return = typename functor_trait<T_functor>::result_type>
struct exception_catch_functor : public adapts<T_functor>
{
public:
diff --git a/sigc++/adaptors/hide.h b/sigc++/adaptors/hide.h
index 2fe93b3..4994113 100644
--- a/sigc++/adaptors/hide.h
+++ b/sigc++/adaptors/hide.h
@@ -69,11 +69,7 @@ namespace sigc
template <int I_location, class T_functor>
struct hide_functor : public adapts<T_functor>
{
-private:
- using adaptor_type = typename adapts<T_functor>::adaptor_type;
-
-public:
- using result_type = typename adaptor_type::result_type;
+ using result_type = typename functor_trait<T_functor>::result_type;
/** Invokes the wrapped functor, ignoring the argument at index @e I_location (0-indexed).
* @param _A_a Arguments to be passed on to the functor, apart from the ignored argument.
diff --git a/sigc++/adaptors/retype.h b/sigc++/adaptors/retype.h
index 18b3edd..db30056 100644
--- a/sigc++/adaptors/retype.h
+++ b/sigc++/adaptors/retype.h
@@ -61,11 +61,7 @@ namespace sigc
template <class T_functor, class... T_type>
struct retype_functor : public adapts<T_functor>
{
-private:
- using adaptor_type = typename adapts<T_functor>::adaptor_type;
-
-public:
- using result_type = typename adapts<T_functor>::result_type;
+ using result_type = typename functor_trait<T_functor>::result_type;
template <class... T_arg>
decltype(auto) operator()(T_arg... _A_a)
diff --git a/sigc++/adaptors/track_obj.h b/sigc++/adaptors/track_obj.h
index a79ec2d..eab2bfc 100644
--- a/sigc++/adaptors/track_obj.h
+++ b/sigc++/adaptors/track_obj.h
@@ -51,11 +51,8 @@ namespace sigc
template <typename T_functor, typename... T_obj>
class track_obj_functor : public adapts<T_functor>
{
-private:
- using adaptor_type = typename adapts<T_functor>::adaptor_type;
-
public:
- using result_type = typename adaptor_type::result_type;
+ using result_type = typename functor_trait<T_functor>::result_type;
/** Constructs a track_obj_functor object that wraps the passed functor and
* stores a reference to the passed trackable objects.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]