Skip to content

Commit 070095a

Browse files
committed
Revert "test_rvalue_ref: Small fixes"
This reverts commit 01652fd.
1 parent 01652fd commit 070095a

File tree

11 files changed

+28
-34
lines changed

11 files changed

+28
-34
lines changed

sigc++/functors/slot.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,8 @@ struct slot_call
151151
static T_return call_it(slot_rep* rep, type_trait_take_t<T_arg>... a_)
152152
{
153153
auto typed_rep = static_cast<typed_slot_rep<T_functor>*>(rep);
154-
return (*typed_rep->functor_)
155-
.template operator()<type_trait_take_t<T_arg>...>(
156-
std::forward<type_trait_take_t<T_arg>>(a_)...);
154+
return (*typed_rep->functor_).template operator()<type_trait_take_t<T_arg>...>(
155+
std::forward<type_trait_take_t<T_arg>>(a_)...);
157156
}
158157

159158
/** Forms a function pointer from call_it().

sigc++/signal.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,8 @@ struct signal_emit<void, void, T_arg...>
364364
continue;
365365

366366
(sigc::internal::function_pointer_cast<call_type>(slot.rep_->call_))(
367-
slot.rep_, std::forward<type_trait_take_t<T_arg>>(a)...);
367+
slot.rep_,
368+
std::forward<type_trait_take_t<T_arg>>(a)...);
368369
}
369370
}
370371
};
@@ -455,8 +456,7 @@ class signal_with_accumulator : public signal_base
455456
}
456457

457458
/** Triggers the emission of the signal (see emit()). */
458-
decltype(auto) operator()(type_trait_take_t<T_arg>... a) const
459-
{
459+
decltype(auto) operator()(type_trait_take_t<T_arg>... a) const {
460460
return emit(std::forward<type_trait_take_t<T_arg>>(a)...);
461461
}
462462

tests/.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
/test_ptr_fun
2525
/test_retype
2626
/test_retype_return
27-
/test_rvalue_ref
2827
/test_signal
2928
/test_signal_move
3029
/test_size

tests/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ set (TEST_SOURCE_FILES
3939
test_ptr_fun.cc
4040
test_retype.cc
4141
test_retype_return.cc
42-
test_rvalue_ref.cc
4342
test_signal.cc
4443
test_signal_move.cc
4544
test_size.cc

tests/Makefile.am

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ check_PROGRAMS = \
4646
test_ptr_fun \
4747
test_retype \
4848
test_retype_return \
49-
test_rvalue_ref \
5049
test_signal \
5150
test_signal_move \
5251
test_size \
@@ -91,7 +90,6 @@ test_mem_fun_SOURCES = test_mem_fun.cc $(sigc_test_util)
9190
test_ptr_fun_SOURCES = test_ptr_fun.cc $(sigc_test_util)
9291
test_retype_SOURCES = test_retype.cc $(sigc_test_util)
9392
test_retype_return_SOURCES = test_retype_return.cc $(sigc_test_util)
94-
test_rvalue_ref_SOURCES = test_rvalue_ref.cc $(sigc_test_util)
9593
test_signal_SOURCES = test_signal.cc $(sigc_test_util)
9694
test_signal_move_SOURCES = test_signal_move.cc $(sigc_test_util)
9795
test_size_SOURCES = test_size.cc $(sigc_test_util)

tests/test_bind.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ struct book : public sigc::trackable
7070
book& operator=(book&&) = delete;
7171

7272
std::string& get_name() { return name_; }
73-
operator std::string&() { return get_name(); }
73+
operator std::string &() { return get_name(); }
7474

7575
private:
7676
std::string name_;

tests/test_cpp11_lambda.cc

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ egon(std::string& str)
8888
struct book : public sigc::trackable
8989
{
9090
explicit book(const std::string& name) : name_(name) {}
91-
operator std::string&() { return name_; }
91+
operator std::string &() { return name_; }
9292
std::string name_;
9393
};
9494

@@ -184,8 +184,8 @@ main(int argc, char* argv[])
184184
// See https://bugzilla.gnome.org/show_bug.cgi?id=669128
185185
// std::cout << "((++_1)*2)(ref(a)): " << ((++_1)*2)(std::ref(a));
186186
// std::cout << "; a: " << a << std::endl;
187-
result_stream << ([](std::reference_wrapper<int> x) -> int
188-
{ return ++x * 2; }(std::ref(a_outer)));
187+
result_stream << ([](std::reference_wrapper<int> x) -> int { return ++x * 2; }(
188+
std::ref(a_outer)));
189189
result_stream << " " << a_outer;
190190
util->check_result(result_stream, "4 2");
191191
result_stream << ([](int& x) -> int { return ++x * 2; }(a_outer));
@@ -200,8 +200,8 @@ main(int argc, char* argv[])
200200

201201
// std::cout << "((--(*(&_1)))*2)(ref(a)): " << ((--(*(&_1)))*2)(std::ref(a));
202202
// std::cout << "; a: " << a << std::endl;
203-
result_stream << ([](std::reference_wrapper<int> x) -> int
204-
{ return --(*(&x)) * 2; }(std::ref(a_outer)));
203+
result_stream << ([](std::reference_wrapper<int> x) -> int { return --(*(&x)) * 2; }(
204+
std::ref(a_outer)));
205205
result_stream << " " << a_outer;
206206
util->check_result(result_stream, "6 3");
207207
result_stream << ([](int& x) -> int { return --(*(&x)) * 2; }(a_outer));
@@ -234,8 +234,8 @@ main(int argc, char* argv[])
234234
// std::cout << "(var(c) = (var(a) = _1, var(b) = _2))(2,3): "
235235
// << (sigc::var(c) = (sigc::var(a) = _1, sigc::var(b) = _2))(2,3);
236236
// std::cout << "; a: " << a << "; b: " << b << "; c: " << c << std::endl;
237-
result_stream << ([&a_outer, &b_outer, &c_outer](int x, int y) -> int
238-
{ return c_outer = (a_outer = x, b_outer = y); }(2, 3));
237+
result_stream << ([&a_outer, &b_outer, &c_outer](
238+
int x, int y) -> int { return c_outer = (a_outer = x, b_outer = y); }(2, 3));
239239
result_stream << " " << a_outer << " " << b_outer << " " << c_outer;
240240
util->check_result(result_stream, "3 2 3 3");
241241

tests/test_member_method_trait.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ test_member_method_is_volatile()
6060
sigc::internal::member_method_is_volatile<decltype(&Something::some_volatile_func)>::value,
6161
"member_method_is_const failed to identify a volatile member method.");
6262

63-
static_assert(sigc::internal::member_method_is_volatile<
64-
decltype(&Something::some_const_volatile_func)>::value,
63+
static_assert(sigc::internal::member_method_is_volatile<decltype(
64+
&Something::some_const_volatile_func)>::value,
6565
"member_method_is_const failed to identify a volatile member method.");
6666
}
6767

tests/test_rvalue_ref.cc

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22
#include <iostream>
33
#include <sigc++/signal.h>
44

5-
struct MoveableStruct
6-
{
7-
};
5+
struct MoveableStruct {};
86

97
namespace
108
{
@@ -13,15 +11,18 @@ std::ostringstream result_stream;
1311

1412
struct foo
1513
{
16-
void operator()(MoveableStruct&& /* x */) { result_stream << "foo(MoveableStruct&&)"; }
14+
void operator()(MoveableStruct &&x)
15+
{
16+
result_stream << "foo(MoveableStruct&&)";
17+
}
1718
};
1819

1920
} // end anonymous namespace
2021

2122
void
2223
test_signal()
2324
{
24-
sigc::signal<void(MoveableStruct &&)> signal;
25+
sigc::signal<void (MoveableStruct &&)> signal;
2526
foo f;
2627
signal.connect(f);
2728
MoveableStruct x;
@@ -32,7 +33,7 @@ test_signal()
3233
void
3334
test_slot()
3435
{
35-
sigc::slot<void(MoveableStruct &&)> slot;
36+
sigc::slot<void (MoveableStruct &&)> slot;
3637
foo f;
3738
slot = f;
3839
MoveableStruct x;

tests/test_signal.cc

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -117,12 +117,10 @@ test_clear_called_in_signal_handler()
117117
{
118118
sigc::signal<void()> sig;
119119
sig.connect([]() { result_stream << ", slot 1, "; });
120-
sig.connect(
121-
[&sig]()
122-
{
123-
sig.clear();
124-
result_stream << "slot 2, ";
125-
});
120+
sig.connect([&sig]() {
121+
sig.clear();
122+
result_stream << "slot 2, ";
123+
});
126124
sig.connect([]() { result_stream << "slot 3, "; });
127125
result_stream << sig.size();
128126
sig.emit();

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