| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
trackable_signal_with_accumulator derives from trackable.
A slot made with trackable_signal_with_accumulator::make_slot() is
automatically disconnected when the signal is deleted, as in sigc++2.
Fixes #80
|
|
|
|
|
| |
This reverts commit 8fb78907ccf3c4425d23ba1555f365f22d376685.
It's not safe. See #80
|
|
|
|
|
|
| |
A slot made with signal_with_accumulator::make_slot() is then
automatically disconnected when the signal is deleted, as in sigc++2.
Fixes #80
|
|
|
|
|
| |
and therefore the made slot must be manually disconnected if the
signal is deleted. See #80
|
| |
|
|
|
|
|
|
| |
Doxygen creates links to sigc::slot and sigc::signal only if
template parameters are included in the documentation.
sigc::slot<T_return(T_arg...)>, sigc::signal<T_return(T_arg...)>.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* tests/.gitignore:
* tests/CMakeLists.txt:
* tests/Makefile.am: Add test_rvalue_ref.
* tests/test_rvalue_ref.cc: Avoid [-Werror=unused-parameter]
when building with warnings=fatal.
Some files have been reformated with clang-format in order to
make the CI tests happy. Reformated with clang-format 12, but CI
uses clang-format 10.
|
|
|
|
| |
This reverts commit 01652fdbc9f6fc2e72b217c9de8c89c93f95ba7c.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* tests/.gitignore:
* tests/CMakeLists.txt:
* tests/Makefile.am: Add test_rvalue_ref.
* tests/test_rvalue_ref.cc: Avoid [-Werror=unused-parameter]
when building with warnings=fatal.
Some files have also been reformated with clang-format in order to
make the CI tests happy. Reformated with clang-format 12, but CI
uses clang-format 10.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In code based on Glibmm it's quite common to convert a Glib C structure
to a Glib::Object's descendant before passing it as a parameter to a
slot. If the slot is not supposed to modify the object, then everything
is fine, we can declare the parameter as a const reference and the
temporary object will be accurately dealt with by the compiler. However,
if the Glib based object is getting modified, the only way to pass it to
the slot is to declare it a Glib::RefPtr shared pointer. This creates a
lot of unnecessary churn of memory allocations for a simple deal of
calling a signal. However, C++ has a specific mean for this particular
semantic of passing a temporary object: rvalue reference.
For example, somewhere inside Gtkmm might be a declaration:
_WRAP_SIGNAL(void sun_rose(const Glib::RefPtr<Gtk::Sun> &new_sun),
"sun-rose")
Instead its more semantically correct to write:
_WRAP_SIGNAL(void sun_rose(Gtk::Sun &&new_sun), "sun-rose")
And later somewhere in your code:
world->signal_sun_rose().connect([&](auto &&new_sun) {
new_sun.shine();
});
This commit makes a couple of simple modifications that allow declaring
signals and slots with rvalue reference parameter.
|
|
|
|
|
| |
This expected a result_type type alias. Luckily, in the few places where
we use this, we always specify the type, ignoring the default.
|
| |
|
|
|
|
|
|
| |
Hide the forward declarations of sigc::slot and sigc::signal from Doxygen.
If Doxygen sees the forward declarations, it does not care about what's
in the complete class definitions.
|
|
|
|
|
|
|
|
|
|
| |
gcc8 -Wextra prints a warning when a single reinterpret_cast is used for
conversion between different types of function pointers. The previous fix
with a union in sigc::internal::bitwise_equivalent_cast<>() is not standard
C++. Rename the function to function_pointer_cast<>(), and use two
reinterpret_casts as recommended in gcc's documentation.
Fixes #8
|
|
|
|
|
| |
Otherwise indirect calls from glibmm, with its own bitwise_equivalent_cast(),
can be ambiguous due to ACL (argument-dependent lookup).
|
|
|
|
|
|
|
|
|
| |
gcc8 -Wextra prints a warning when reinterpret_cast is used for conversion
between different types of function pointers. Avoid that by adding
sigc::internal::bitwise_equivalent_cast<>() with a union with members of
the two types of function pointers.
Fixes #1
|
|
|
|
|
|
| |
This reverts commit c7dbcd5df0e6c260d50fe12dfb2b87a002d91985.
This can be done in a better way by keeping the union in a template function.
|
|
|
|
|
|
|
|
| |
gcc8 -Wextra prints a warning when reinterpret_cast is used for conversion
between different types of function pointers. Avoid that by instead using
a union with members of the two types of function pointers.
Fixes #1
|
| |
|
| |
|
| |
|
|
|
|
| |
To make it more obvious that these are copy operations.
|
|
|
|
| |
Because that's what it does. It doesn't execute anything.
|
|
|
|
| |
Bug #764935
|
|
|
|
| |
This constructor existed before, so this avoids an API break.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
Instead of an iterator aliases to a signal<>::connection.
|
| |
|
|
|
|
| |
And the unused slot_list methods that use it.
|
| |
|
|
|
|
| |
It is still actually an iterator, but we can change that later.
|
| |
|
|
|
|
|
| |
Because it does not seem useful.
Also remove the unused extra iterator types and the const slot().
|
|
|
|
|
| |
It is not used in any tests or examples. Let's see if anybody actually
uses it.
|
| |
|
| |
|
| |
|
|
|
|
|
| |
Because that's what it is.
And avoid the need for a __ prefix on the input parameter.
|
|
|
|
| |
Leading underscores are reserved in C++.
|
|
|
|
| |
Leading underscores are reserved in C++, and the A is just odd.
|
|
|
|
| |
Names with leading underscores are reserved in C++.
|
|
|
|
|
|
|
|
|
| |
Apart from template template parameters, which must still be class
according to the C++14 standard:
http://stackoverflow.com/a/11311432/1123654
though g++ and clang++ actually already supporting using typename
instead by implementing N4051:
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4051.html
|
|
|
|
|
|
|
|
| |
This reverts commit 180353986d101e367c26b3199c44c7b2e4c1e681.
Because I misread https://stackoverflow.com/questions/213121/use-class-or-typename-for-template-parameters
class is _still_ needed for template template parameters in C++14,
though g++ and clang++ seem to support it anyway.
|
|
|
|
|
|
|
| |
For consistency. As of C++14 class is not necessary even
for template template parameters. We can change those few uses back
to class if any (otherwise compliant-enough) compiler actually needs it.
See http://stackoverflow.com/a/11311432/1123654
|