Skip to content

Commit e048258

Browse files
committed
tests: Remove unnecessary result_type aliases
This was necessary with older pre-C++11 versions of libsigc++.
1 parent 294ce71 commit e048258

File tree

8 files changed

+2
-38
lines changed

8 files changed

+2
-38
lines changed

tests/test_accum_iter.cc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ ident(int i)
1919
template<typename T>
2020
struct min_accum
2121
{
22-
using result_type = T;
23-
2422
template<typename I>
2523
decltype(auto) operator()(I i1, I i2)
2624
{

tests/test_accumulated.cc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ std::ostringstream result_stream;
1616

1717
struct arithmetic_mean_accumulator
1818
{
19-
using result_type = double;
2019
template<typename T_iterator>
2120
double operator()(T_iterator first, T_iterator last) const
2221
{
@@ -31,11 +30,10 @@ struct arithmetic_mean_accumulator
3130
template<typename Ret>
3231
struct vector_accumulator
3332
{
34-
using result_type = std::vector<Ret>;
3533
template<typename T_iterator>
36-
result_type operator()(T_iterator first, T_iterator last) const
34+
std::vector<Ret> operator()(T_iterator first, T_iterator last) const
3735
{
38-
result_type vec;
36+
std::vector<Ret> vec;
3937
for (; first != last; ++first)
4038
vec.push_back(*first);
4139
return vec;

tests/test_bind.cc

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@ std::ostringstream result_stream;
1212

1313
struct foo
1414
{
15-
// choose a type that can hold all return values
16-
using result_type = int;
17-
1815
int operator()(int i)
1916
{
2017
result_stream << "foo(int " << i << ") ";
@@ -36,8 +33,6 @@ struct foo
3633

3734
struct foo_void
3835
{
39-
using result_type = void;
40-
4136
void operator()(int i) { result_stream << "foo_void(int " << i << ")"; }
4237
};
4338

tests/test_compose.cc

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@ std::ostringstream result_stream;
1111

1212
struct set
1313
{
14-
// choose a type that can hold all return values
15-
using result_type = double;
16-
1714
double operator()(int i)
1815
{
1916
result_stream << "set(int " << i << ") ";
@@ -29,8 +26,6 @@ struct set
2926

3027
struct set_void
3128
{
32-
using result_type = void;
33-
3429
void operator()(double i) { result_stream << "set_void(double " << i << ")"; }
3530
};
3631

@@ -55,9 +50,6 @@ struct get
5550
return double(i) / double(j);
5651
}
5752
#else
58-
// choose a type that can hold all return values
59-
using result_type = double;
60-
6153
double operator()()
6254
{
6355
result_stream << "get() ";

tests/test_exception_catch.cc

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ std::ostringstream result_stream;
1111

1212
struct f
1313
{
14-
using result_type = int;
15-
1614
int operator()(int i)
1715
{
1816
result_stream << "f(int " << i << ") ";
@@ -22,8 +20,6 @@ struct f
2220

2321
struct g
2422
{
25-
using result_type = int;
26-
2723
int operator()()
2824
{
2925
result_stream << "g() ";
@@ -33,8 +29,6 @@ struct g
3329

3430
struct g_void
3531
{
36-
using result_type = void;
37-
3832
void operator()()
3933
{
4034
result_stream << "g_void() ";

tests/test_hide.cc

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@ std::ostringstream result_stream;
1111

1212
struct foo
1313
{
14-
// choose a type that can hold all return values
15-
using result_type = int;
16-
1714
int operator()()
1815
{
1916
result_stream << "foo() ";
@@ -29,8 +26,6 @@ struct foo
2926

3027
struct foo_void
3128
{
32-
using result_type = void;
33-
3429
void operator()() { result_stream << "foo_void()"; }
3530
};
3631

tests/test_retype_return.cc

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ std::ostringstream result_stream;
1212

1313
struct foo
1414
{
15-
using result_type = float;
16-
1715
float operator()(int i)
1816
{
1917
result_stream << "foo(int " << i << ") ";
@@ -29,8 +27,6 @@ struct foo
2927

3028
struct bar : public sigc::trackable
3129
{
32-
using result_type = int;
33-
3430
int operator()(int i)
3531
{
3632
result_stream << "bar(int " << i << ")";

tests/test_track_obj.cc

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@ struct bar_group4 : public sigc::trackable
5252
class Functor1
5353
{
5454
public:
55-
using result_type = std::string;
56-
5755
explicit Functor1(const bar_group4& bar) : bar_(bar) {}
5856

5957
std::string operator()(int i) { return (i < 0) ? "negative" : ((i > 0) ? "positive" : "zero"); }
@@ -66,8 +64,6 @@ class Functor1
6664
class Functor2
6765
{
6866
public:
69-
using result_type = std::string;
70-
7167
Functor2(const bar_group4& bar, const book& aBook) : bar_(bar), aBook_(aBook) {}
7268

7369
std::string operator()(int i, const std::string& str) const

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy