summaryrefslogtreecommitdiff
path: root/sigc++/adaptors
diff options
context:
space:
mode:
authorMurray Cumming <murrayc@murrayc.com>2016-04-13 21:15:07 +0200
committerMurray Cumming <murrayc@murrayc.com>2016-04-13 21:45:20 +0200
commit53bbbe7c8c72224ae3c6b647706857218936d833 (patch)
treea0ac7f6bd86b38f925d4e1d1c4b9060f823984fb /sigc++/adaptors
parente3c79b706dd181c2f8f0e3c812759d7d8d3e183a (diff)
downloadsigc++-53bbbe7c8c72224ae3c6b647706857218936d833.tar.gz
Remove all remaining result_type aliases.
They are not actually needed by anything.
Diffstat (limited to 'sigc++/adaptors')
-rw-r--r--sigc++/adaptors/adaptor_base.h3
-rw-r--r--sigc++/adaptors/adapts.h3
-rw-r--r--sigc++/adaptors/bind.h4
-rw-r--r--sigc++/adaptors/bind_return.h2
-rw-r--r--sigc++/adaptors/compose.h2
-rw-r--r--sigc++/adaptors/exception_catch.h43
-rw-r--r--sigc++/adaptors/hide.h2
-rw-r--r--sigc++/adaptors/retype.h2
-rw-r--r--sigc++/adaptors/retype_return.h4
-rw-r--r--sigc++/adaptors/track_obj.h2
10 files changed, 5 insertions, 62 deletions
diff --git a/sigc++/adaptors/adaptor_base.h b/sigc++/adaptors/adaptor_base.h
index 92a7b8a..55f412d 100644
--- a/sigc++/adaptors/adaptor_base.h
+++ b/sigc++/adaptors/adaptor_base.h
@@ -9,9 +9,6 @@ namespace sigc
* Functors which have all methods based on templates
* should publicly inherit from this hint.
*
- * adaptor_base inherits from the functor_base hint so
- * derived types should also have a result_type defined.
- *
* Adaptors don't inherit from this type directly. They use
* use sigc::adapts as a base type instead. sigc::adaptors
* wraps arbitrary functor types as well as function pointers
diff --git a/sigc++/adaptors/adapts.h b/sigc++/adaptors/adapts.h
index c7af3a6..a88461d 100644
--- a/sigc++/adaptors/adapts.h
+++ b/sigc++/adaptors/adapts.h
@@ -27,9 +27,8 @@ namespace sigc
* template <class T_functor>
* struct my_adaptor : public sigc::adapts<T_functor>
* {
- * using result_type = typename sigc::functor_trait<T_functor>::result_type;
* //
- * result_type
+ * decltype(auto)
* operator()() const;
* //
* template <class T_arg1>
diff --git a/sigc++/adaptors/bind.h b/sigc++/adaptors/bind.h
index 0d9a02c..59bd4e6 100644
--- a/sigc++/adaptors/bind.h
+++ b/sigc++/adaptors/bind.h
@@ -107,8 +107,6 @@ struct TransformEachInvoker
template <int I_location, class T_functor, class... T_bound>
struct bind_functor : public adapts<T_functor>
{
- 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.
* @param _A_arg Arguments to be passed on to the functor.
@@ -167,8 +165,6 @@ template <class T_functor, class... T_type>
struct bind_functor<-1, T_functor, T_type...> : public adapts<T_functor>
{
public:
- 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.
* @param _A_arg Arguments to be passed on to the functor.
diff --git a/sigc++/adaptors/bind_return.h b/sigc++/adaptors/bind_return.h
index 74c4738..47296bc 100644
--- a/sigc++/adaptors/bind_return.h
+++ b/sigc++/adaptors/bind_return.h
@@ -19,8 +19,6 @@ namespace sigc
template <class T_return, class T_functor>
struct bind_return_functor : public adapts<T_functor>
{
- using result_type = typename unwrap_reference<T_return>::type;
-
/** Invokes the wrapped functor dropping its return value.
* @return The fixed return value.
*/
diff --git a/sigc++/adaptors/compose.h b/sigc++/adaptors/compose.h
index 2e5af90..bd4ef93 100644
--- a/sigc++/adaptors/compose.h
+++ b/sigc++/adaptors/compose.h
@@ -45,7 +45,6 @@ struct compose1_functor : public adapts<T_setter>
{
using setter_type = T_setter;
using getter_type = T_getter;
- using result_type = typename functor_trait<T_setter>::result_type;
decltype(auto) operator()() { return this->functor_(get_()); }
@@ -88,7 +87,6 @@ public:
using setter_type = T_setter;
using getter1_type = T_getter1;
using getter2_type = T_getter2;
- using result_type = typename adaptor_type::result_type;
decltype(auto) operator()() { return this->functor_(get1_(), get2_()); }
diff --git a/sigc++/adaptors/exception_catch.h b/sigc++/adaptors/exception_catch.h
index 1bddd7c..164fd91 100644
--- a/sigc++/adaptors/exception_catch.h
+++ b/sigc++/adaptors/exception_catch.h
@@ -55,13 +55,9 @@ namespace sigc
* @ingroup adaptors
*/
-template <class T_functor, class T_catcher,
- class T_return = typename functor_trait<T_functor>::result_type>
+template <class T_functor, class T_catcher>
struct exception_catch_functor : public adapts<T_functor>
{
-public:
- using result_type = T_return;
-
decltype(auto) operator()()
{
try
@@ -95,45 +91,14 @@ public:
T_catcher catcher_;
};
-// void specialization
-template <class T_functor, class T_catcher>
-struct exception_catch_functor<T_functor, T_catcher, void> : public adapts<T_functor>
-{
-public:
- using result_type = void;
-
-
- template <class... T_arg>
- decltype(auto) operator()(T_arg... _A_a)
- {
- try
- {
- return this->functor_.template operator()<type_trait_pass_t<T_arg>...>(_A_a...);
- }
- catch (...)
- {
- return catcher_();
- }
- }
-
- exception_catch_functor() = default;
- exception_catch_functor(const T_functor& _A_func, const T_catcher& _A_catcher)
- : adapts<T_functor>(_A_func), catcher_(_A_catcher)
- {
- }
- ~exception_catch_functor() = default;
-
- T_catcher catcher_;
-};
-
#ifndef DOXYGEN_SHOULD_SKIP_THIS
// template specialization of visitor<>::do_visit_each<>(action, functor):
-template <class T_functor, class T_catcher, class T_return>
-struct visitor<exception_catch_functor<T_functor, T_catcher, T_return>>
+template <class T_functor, class T_catcher>
+struct visitor<exception_catch_functor<T_functor, T_catcher>>
{
template <typename T_action>
static void do_visit_each(const T_action& _A_action,
- const exception_catch_functor<T_functor, T_catcher, T_return>& _A_target)
+ const exception_catch_functor<T_functor, T_catcher>& _A_target)
{
sigc::visit_each(_A_action, _A_target.functor_);
sigc::visit_each(_A_action, _A_target.catcher_);
diff --git a/sigc++/adaptors/hide.h b/sigc++/adaptors/hide.h
index 4994113..78e379c 100644
--- a/sigc++/adaptors/hide.h
+++ b/sigc++/adaptors/hide.h
@@ -69,8 +69,6 @@ namespace sigc
template <int I_location, class T_functor>
struct hide_functor : public adapts<T_functor>
{
- 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.
* @return The return value of the functor invocation.
diff --git a/sigc++/adaptors/retype.h b/sigc++/adaptors/retype.h
index db30056..7e75e47 100644
--- a/sigc++/adaptors/retype.h
+++ b/sigc++/adaptors/retype.h
@@ -61,8 +61,6 @@ namespace sigc
template <class T_functor, class... T_type>
struct retype_functor : public adapts<T_functor>
{
- 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/retype_return.h b/sigc++/adaptors/retype_return.h
index 5551d92..bbe8241 100644
--- a/sigc++/adaptors/retype_return.h
+++ b/sigc++/adaptors/retype_return.h
@@ -18,8 +18,6 @@ namespace sigc
template <class T_return, class T_functor>
struct retype_return_functor : public adapts<T_functor>
{
- using result_type = T_return;
-
T_return operator()();
template <class... T_arg>
@@ -60,8 +58,6 @@ retype_return_functor<T_return, T_functor>::operator()()
template <class T_functor>
struct retype_return_functor<void, T_functor> : public adapts<T_functor>
{
- using result_type = void;
-
void operator()();
template <class... T_arg>
diff --git a/sigc++/adaptors/track_obj.h b/sigc++/adaptors/track_obj.h
index eab2bfc..f1b2f71 100644
--- a/sigc++/adaptors/track_obj.h
+++ b/sigc++/adaptors/track_obj.h
@@ -52,8 +52,6 @@ template <typename T_functor, typename... T_obj>
class track_obj_functor : public adapts<T_functor>
{
public:
- 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.
* @param _A_func Functor.