summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMurray Cumming <murrayc@murrayc.com>2019-10-27 17:11:11 +0100
committerMurray Cumming <murrayc@murrayc.com>2019-10-29 10:49:13 +0100
commite04825847c4b0a7de302f124de284d9d6c08a2ca (patch)
tree449130ba68e755a75b96ccc2e5e952c7a42b6682
parent294ce7177c5315e2ada29acd184900dcda4289c8 (diff)
downloadsigc++-e04825847c4b0a7de302f124de284d9d6c08a2ca.tar.gz
tests: Remove unnecessary result_type aliases
This was necessary with older pre-C++11 versions of libsigc++.
-rw-r--r--tests/test_accum_iter.cc2
-rw-r--r--tests/test_accumulated.cc6
-rw-r--r--tests/test_bind.cc5
-rw-r--r--tests/test_compose.cc8
-rw-r--r--tests/test_exception_catch.cc6
-rw-r--r--tests/test_hide.cc5
-rw-r--r--tests/test_retype_return.cc4
-rw-r--r--tests/test_track_obj.cc4
8 files changed, 2 insertions, 38 deletions
diff --git a/tests/test_accum_iter.cc b/tests/test_accum_iter.cc
index 736d73f..10f70e1 100644
--- a/tests/test_accum_iter.cc
+++ b/tests/test_accum_iter.cc
@@ -19,8 +19,6 @@ ident(int i)
template<typename T>
struct min_accum
{
- using result_type = T;
-
template<typename I>
decltype(auto) operator()(I i1, I i2)
{
diff --git a/tests/test_accumulated.cc b/tests/test_accumulated.cc
index 5ac760b..f010b1c 100644
--- a/tests/test_accumulated.cc
+++ b/tests/test_accumulated.cc
@@ -16,7 +16,6 @@ std::ostringstream result_stream;
struct arithmetic_mean_accumulator
{
- using result_type = double;
template<typename T_iterator>
double operator()(T_iterator first, T_iterator last) const
{
@@ -31,11 +30,10 @@ struct arithmetic_mean_accumulator
template<typename Ret>
struct vector_accumulator
{
- using result_type = std::vector<Ret>;
template<typename T_iterator>
- result_type operator()(T_iterator first, T_iterator last) const
+ std::vector<Ret> operator()(T_iterator first, T_iterator last) const
{
- result_type vec;
+ std::vector<Ret> vec;
for (; first != last; ++first)
vec.push_back(*first);
return vec;
diff --git a/tests/test_bind.cc b/tests/test_bind.cc
index 7b228e8..0cd192c 100644
--- a/tests/test_bind.cc
+++ b/tests/test_bind.cc
@@ -12,9 +12,6 @@ std::ostringstream result_stream;
struct foo
{
- // choose a type that can hold all return values
- using result_type = int;
-
int operator()(int i)
{
result_stream << "foo(int " << i << ") ";
@@ -36,8 +33,6 @@ struct foo
struct foo_void
{
- using result_type = void;
-
void operator()(int i) { result_stream << "foo_void(int " << i << ")"; }
};
diff --git a/tests/test_compose.cc b/tests/test_compose.cc
index f7f12e5..9091bc8 100644
--- a/tests/test_compose.cc
+++ b/tests/test_compose.cc
@@ -11,9 +11,6 @@ std::ostringstream result_stream;
struct set
{
- // choose a type that can hold all return values
- using result_type = double;
-
double operator()(int i)
{
result_stream << "set(int " << i << ") ";
@@ -29,8 +26,6 @@ struct set
struct set_void
{
- using result_type = void;
-
void operator()(double i) { result_stream << "set_void(double " << i << ")"; }
};
@@ -55,9 +50,6 @@ struct get
return double(i) / double(j);
}
#else
- // choose a type that can hold all return values
- using result_type = double;
-
double operator()()
{
result_stream << "get() ";
diff --git a/tests/test_exception_catch.cc b/tests/test_exception_catch.cc
index 1a1b0be..29c8b32 100644
--- a/tests/test_exception_catch.cc
+++ b/tests/test_exception_catch.cc
@@ -11,8 +11,6 @@ std::ostringstream result_stream;
struct f
{
- using result_type = int;
-
int operator()(int i)
{
result_stream << "f(int " << i << ") ";
@@ -22,8 +20,6 @@ struct f
struct g
{
- using result_type = int;
-
int operator()()
{
result_stream << "g() ";
@@ -33,8 +29,6 @@ struct g
struct g_void
{
- using result_type = void;
-
void operator()()
{
result_stream << "g_void() ";
diff --git a/tests/test_hide.cc b/tests/test_hide.cc
index c0a9911..bec7def 100644
--- a/tests/test_hide.cc
+++ b/tests/test_hide.cc
@@ -11,9 +11,6 @@ std::ostringstream result_stream;
struct foo
{
- // choose a type that can hold all return values
- using result_type = int;
-
int operator()()
{
result_stream << "foo() ";
@@ -29,8 +26,6 @@ struct foo
struct foo_void
{
- using result_type = void;
-
void operator()() { result_stream << "foo_void()"; }
};
diff --git a/tests/test_retype_return.cc b/tests/test_retype_return.cc
index 34c0325..ded2823 100644
--- a/tests/test_retype_return.cc
+++ b/tests/test_retype_return.cc
@@ -12,8 +12,6 @@ std::ostringstream result_stream;
struct foo
{
- using result_type = float;
-
float operator()(int i)
{
result_stream << "foo(int " << i << ") ";
@@ -29,8 +27,6 @@ struct foo
struct bar : public sigc::trackable
{
- using result_type = int;
-
int operator()(int i)
{
result_stream << "bar(int " << i << ")";
diff --git a/tests/test_track_obj.cc b/tests/test_track_obj.cc
index dcbd222..aefdb07 100644
--- a/tests/test_track_obj.cc
+++ b/tests/test_track_obj.cc
@@ -52,8 +52,6 @@ struct bar_group4 : public sigc::trackable
class Functor1
{
public:
- using result_type = std::string;
-
explicit Functor1(const bar_group4& bar) : bar_(bar) {}
std::string operator()(int i) { return (i < 0) ? "negative" : ((i > 0) ? "positive" : "zero"); }
@@ -66,8 +64,6 @@ protected:
class Functor2
{
public:
- using result_type = std::string;
-
Functor2(const bar_group4& bar, const book& aBook) : bar_(bar), aBook_(aBook) {}
std::string operator()(int i, const std::string& str) const