summaryrefslogtreecommitdiff
path: root/sigc++
Commit message (Collapse)AuthorAgeFilesLines
* Add trackable_signal_with_accumulator and trackable_signalKjell Ahlstedt2022-05-312-8/+288
| | | | | | | 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
* Revert "signal_with_accumulator derives from trackable"Kjell Ahlstedt2022-05-312-26/+13
| | | | | This reverts commit 8fb78907ccf3c4425d23ba1555f365f22d376685. It's not safe. See #80
* signal_with_accumulator derives from trackableKjell Ahlstedt2022-05-302-13/+26
| | | | | | A slot made with signal_with_accumulator::make_slot() is then automatically disconnected when the signal is deleted, as in sigc++2. Fixes #80
* Format source code to suit clang-format-12Kjell Ahlstedt2022-05-191-1/+1
| | | | Format sigc++/signal_base.h.
* signal::make_slot() docs: Note that signal does not derive from trackableKjell Ahlstedt2022-05-192-0/+11
| | | | | and therefore the made slot must be manually disconnected if the signal is deleted. See #80
* Fix some commentsKjell Ahlstedt2022-04-275-8/+12
|
* Format source code to suit clang-format-12Kjell Ahlstedt2022-04-201-2/+2
| | | | Format sigc++/adaptors/track_obj.h.
* Add track_object(), deprecate track_obj()Kjell Ahlstedt2022-04-201-8/+37
| | | | | track_object() checks that the listed objects derive from sigc::trackable. Fixes #78
* docs: Fix links to sigc::slot and sigc::signalKjell Ahlstedt2021-12-299-31/+40
| | | | | | 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...)>.
* ptr_fun(), mem_fun() docs: Remove left-overs from sigc++-2.0Kjell Ahlstedt2021-12-262-16/+13
| | | | | Some documentation of template parameters described sigc++-2.0 rather than sigc++-3.0.
* Second attempt to suit clang-format 10Kjell Ahlstedt2021-12-232-6/+3
| | | | | | Irritating that different versions of clang-format don't agree on what's an acceptable format, and that clang-format 10 is not easily installable on Ubuntu 21.10.
* Format source code to suit clang-formatKjell Ahlstedt2021-12-232-6/+11
| | | | | | | | | | * sigc++/functors/mem_fun.h: * sigc++/functors/ptr_fun.h: * tests/test_rvalue_ref.cc: Reformated with clang-format 13, but CI uses clang-format 10. Also add #include <utility> where std::forward was added. Doesn't seem to be necessary with g++ or clang++. Mostly a precaution.
* Add missing perfect forwarding in mem_functor and pointer_functorSlava Andrejev2021-12-232-2/+4
| | | | | This is a missed addition to the commit that allowed rvalue references in slot parameters.
* Add missing perfect forwarding in bound_mem_functor::operator()Slava Andrejev2021-12-231-1/+3
| | | | | This is a missed addition to the commit that allowed rvalue references in slot parameters.
* test_rvalue_ref: Small fixesKjell Ahlstedt2021-06-022-5/+6
| | | | | | | | | | | | * 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.
* Revert "test_rvalue_ref: Small fixes"Kjell Ahlstedt2021-06-022-6/+5
| | | | This reverts commit 01652fdbc9f6fc2e72b217c9de8c89c93f95ba7c.
* test_rvalue_ref: Small fixesKjell Ahlstedt2021-06-022-5/+6
| | | | | | | | | | | | * 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.
* Allow slots with rvalue reference parametersSlava Andrejev2021-06-023-5/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Meson build: No implicit_include_directoriesKjell Ahlstedt2021-03-261-0/+1
| | | | | It shall not be possible to find a sigc++ header file with #include <xxx.h> instead of #include <sigc++/xxx.h>.
* Meson build: Make it possible to use sigc++ as a subprojectKjell Ahlstedt2021-03-121-4/+4
| | | | mm-common can be a subproject of sigc++.
* run make format (with clang-format-10), to format the codeMurray Cumming2021-01-241-1/+2
|
* sigc++/sigc++.h: Fix a typoKjell Ahlstedt2020-10-121-1/+1
|
* sigc++/sigc++.h: Describe how to use libsigc++ with mesonKjell Ahlstedt2020-10-121-0/+19
|
* Docs: Change libsigc++ webpage mentions to GitHubKjell Ahlstedt2020-10-041-5/+3
| | | | | Change libsigc.sourceforge.net to libsigcplusplus.github.io/libsigcplusplus.
* Meson build: fix versioning on macOSTom Schoonjans2020-09-281-1/+2
| | | | See pull request #65
* sigc++/meson.build: Library name is sigc-3.0Kjell Ahlstedt2019-12-291-2/+3
| | | | Pointed out by Chun-wei Fan in PR #51.
* meson: Build Windows .rc files on WindowsChun-wei Fan2019-12-291-0/+9
| | | | | This ensures that on Windows, the version info resources are indeed linked into the libsigc++ DLL.
* Meson: Fix Visual Studio buildsChun-wei Fan2019-12-201-0/+8
| | | | | We need to make sure that SIGC_BUILD and _WINDLL are defined when building the libsigc++ DLL, so that it gets build properly.
* Add support for building libsigc++-3.0 with MesonKjell Ahlstedt2019-12-201-0/+86
| | | | libsigc++-3.0 can be built with either Autotools or Meson.
* signal: slot_iterator_buf: Remove T_result default typeMurray Cumming2019-10-291-1/+1
| | | | | This expected a result_type type alias. Luckily, in the few places where we use this, we always specify the type, ignoring the default.
* Reformat code with make formatMurray Cumming2019-10-2834-410/+381
|
* sigc++/adaptors/bind.h: Make bind_functor::bound_ publicKjell Ahlstedt2019-10-271-1/+2
| | | | | | It's used by sigc::visitor::do_visit_each(). Add a test case in tests/test_bind.cc. Fixes #26
* MSVC build: Add code commentsStuart Dootson2019-10-254-0/+5
|
* MSVC build: Silence 'C4100: unreferenced formal parameter' warningsStuart Dootson2019-10-254-0/+6
| | | Added 'static_cast<void>(parameter-name)' in all paths where the parameter isn't used
* MSVC build: Fix 'C4127: conditional expression is constant' warningStuart Dootson2019-10-251-5/+3
|
* Empty connections can be safely copied nowAIGRIND2019-09-261-2/+5
| | | | | | | | | | | | Copy constructor and `operator=` could fail if `src` was empty. ``` sigc::connection con1; sigc::connection con2(con1); // failed ``` ``` sigc::connection con3; sigc::connection con4; con3 = con4; // failed ```
* tuple_transform_each(): Fix for libc++Kjell Ahlstedt2019-09-021-5/+8
| | | | | | | | | Tuples which are input data to std::tuple_cat() are not declared const. Some versions of libc++ has a bug in std::tuple_cat(): All output elements coming from a const tuple become const. It can break 'make check' when using clang++ and -stdlib=libc++. Fixes issue #25
* bind(), track_obj() documentation: Remove obsolete restrictionsKjell Ahlstedt2019-08-292-3/+0
| | | | | | The number of objects and arguments are not restricted to max 7 now that variadic templates have replaced the .m4 files in libsigc++-2 that generated 7 copies.
* CMake: supply SIGC_BUILD and use CMAKE_CXX_STANDARD, for MSVCJeff Trull2019-06-031-0/+1
|
* sigc::tuple_transform_each: std::result_of -> std::invoke_resultKjell Ahlstedt2019-02-171-2/+2
| | | | | | std::result_of is deprecated in C++17 and will be removed in C++20. Fixes issue #19
* Add necessary #include<>sKjell Ahlstedt2018-10-262-0/+3
| | | | | * sigc++/adaptors/tuple_visitor_visit_each.h * sigc++/reference_wrapper.h
* slot, signal: Fix the Doxygen documentationKjell Ahlstedt2018-09-102-0/+4
| | | | | | 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.
* build: Split out source listingChun-wei Fan2018-09-102-5/+7
| | | | | | Consolidate the source listing from sigc++/Makefile.am to sigc++/filelist.am, so that we can let other Makefile-based build systems consume sigc++/filelist.am as well.
* slot, signal: Avoid compiler warnings from function pointer conversionsKjell Ahlstedt2018-08-292-18/+16
| | | | | | | | | | 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
* Qualify calls to bitwise_equivalent_cast() with namespace namesKjell Ahlstedt2018-07-172-5/+10
| | | | | Otherwise indirect calls from glibmm, with its own bitwise_equivalent_cast(), can be ambiguous due to ACL (argument-dependent lookup).
* slot, signal: Avoid compiler warnings from function pointer conversionsKjell Ahlstedt2018-07-162-5/+24
| | | | | | | | | 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
* Revert "slot, signal: Avoid compiler warnings from function pointer conversions"Kjell Ahlstedt2018-07-162-43/+6
| | | | | | This reverts commit c7dbcd5df0e6c260d50fe12dfb2b87a002d91985. This can be done in a better way by keeping the union in a template function.
* slot, signal: Avoid compiler warnings from function pointer conversionsKjell Ahlstedt2018-07-132-6/+43
| | | | | | | | 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
* C++17: Update tuple_transform_each().Murray Cumming2018-04-151-82/+49
| | | | | Update from murrayc-tuple-utils: https://github.com/murraycu/murrayc-tuple-utils/commits/master
* C++17: Update from murrayc-tuple-utils.Murray Cumming2018-04-153-78/+60
| | | | | | | | From https://github.com/murraycu/murrayc-tuple-utils/commits/master This also uses the C++17 nested namespace syntax. Apart from tuple_transform_each, which seems to have a memory access problem, with both g++ and clang++, in its C++17 version.