diff options
author | Kjell Ahlstedt <kjellahlstedt@gmail.com> | 2022-04-27 18:10:48 +0200 |
---|---|---|
committer | Kjell Ahlstedt <kjellahlstedt@gmail.com> | 2022-04-27 18:10:48 +0200 |
commit | 4b829ece84c6dbaa4d89bf4fe6feebd4236b31d1 (patch) | |
tree | fc1f0ea5540cdfa584201507a1fcf3caf7be6ed6 | |
parent | ef8435a8c8694283bbf905b8e53a83bf2144b751 (diff) | |
download | sigc++-4b829ece84c6dbaa4d89bf4fe6feebd4236b31d1.tar.gz |
Fix some comments
-rw-r--r-- | sigc++/adaptors/hide.h | 5 | ||||
-rw-r--r-- | sigc++/functors/slot.h | 7 | ||||
-rw-r--r-- | sigc++/signal.h | 2 | ||||
-rw-r--r-- | sigc++/tuple-utils/tuple_end.h | 2 | ||||
-rw-r--r-- | sigc++/tuple-utils/tuple_start.h | 4 |
5 files changed, 12 insertions, 8 deletions
diff --git a/sigc++/adaptors/hide.h b/sigc++/adaptors/hide.h index 46bc5d3..d8e9579 100644 --- a/sigc++/adaptors/hide.h +++ b/sigc++/adaptors/hide.h @@ -64,8 +64,8 @@ namespace sigc * @par Example: * @code * // multiple argument hiding ... - * sigc::hide(sigc::hide(&foo))(1,2,3,4); // adds two dummy parameters at the back and calls - foo(1,2) + * // adds two dummy parameters at the back and calls foo(1,2) + * sigc::hide(sigc::hide(&foo))(1,2,3,4); * @endcode * sigc::hide_return() alters an arbitrary functor by @@ -79,7 +79,6 @@ namespace sigc * * The following template arguments are used: * - @e I_location Zero-based position of the dummy parameter (@p -1 for the last parameter). - * - @e T_type Type of the dummy parameter. * - @e T_functor Type of the functor to wrap. * * @ingroup hide diff --git a/sigc++/functors/slot.h b/sigc++/functors/slot.h index e368e86..3f4b510 100644 --- a/sigc++/functors/slot.h +++ b/sigc++/functors/slot.h @@ -24,7 +24,6 @@ #include <sigc++/adaptors/adaptor_trait.h> #include <sigc++/functors/slot_base.h> #include <functional> - #include <memory> namespace sigc @@ -230,6 +229,12 @@ public: inline slot() = default; + // If you're tempted to add + // template<typename T_functor, + // std::enable_if_t<std::is_invocable_r_v<T_return, T_functor, T_arg...>, int> = 0> + // to the constructor, see https://github.com/libsigcplusplus/libsigcplusplus/issues/79 + // It doesn't work well when sigc::slot is combined with sigc::hide(). + /** Constructs a slot from an arbitrary functor. * @param func The desired functor the new slot should be assigned to. */ diff --git a/sigc++/signal.h b/sigc++/signal.h index b8e0f26..8f7dadc 100644 --- a/sigc++/signal.h +++ b/sigc++/signal.h @@ -469,7 +469,7 @@ public: */ decltype(auto) make_slot() const { - // TODO: Instead use std::result_of<> on the static emitter_type::emit() + // TODO: Instead use std::invoke_result<> on the static emitter_type::emit() using result_type = typename internal::member_method_result<decltype(&signal_with_accumulator::emit)>::type; return bound_mem_functor<result_type (signal_with_accumulator::*)(type_trait_take_t<T_arg>...) diff --git a/sigc++/tuple-utils/tuple_end.h b/sigc++/tuple-utils/tuple_end.h index 966a6c8..e32d56b 100644 --- a/sigc++/tuple-utils/tuple_end.h +++ b/sigc++/tuple-utils/tuple_end.h @@ -58,7 +58,7 @@ tuple_end(T&& t) { // We use std::decay_t<> because tuple_size is not defined for references. constexpr auto size = std::tuple_size<std::decay_t<T>>::value; - static_assert(len <= size, "The tuple size must be less than or equal to the length."); + static_assert(len <= size, "The tuple size must be greater than or equal to the length."); if constexpr (len == 0) { diff --git a/sigc++/tuple-utils/tuple_start.h b/sigc++/tuple-utils/tuple_start.h index 6c83030..c75fda9 100644 --- a/sigc++/tuple-utils/tuple_start.h +++ b/sigc++/tuple-utils/tuple_start.h @@ -59,7 +59,7 @@ struct tuple_start_impl<T, std::index_sequence<I...>> { constexpr auto size = std::tuple_size<std::decay_t<T>>::value; constexpr auto len = sizeof...(I); - static_assert(len <= size, "The tuple size must be less than or equal to the length."); + static_assert(len <= size, "The tuple size must be greater than or equal to the length."); using start = typename tuple_type_start<std::decay_t<T>, len>::type; return start(std::get<I>(std::forward<T>(t))...); @@ -77,7 +77,7 @@ tuple_start(T&& t) { // We use std::decay_t<> because tuple_size is not defined for references. constexpr auto size = std::tuple_size<std::decay_t<T>>::value; - static_assert(len <= size, "The tuple size must be less than or equal to the length."); + static_assert(len <= size, "The tuple size must be greater than or equal to the length."); return detail::tuple_start_impl<T, std::make_index_sequence<len>>::tuple_start( std::forward<T>(t)); |