From 4b829ece84c6dbaa4d89bf4fe6feebd4236b31d1 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Wed, 27 Apr 2022 18:10:48 +0200 Subject: Fix some comments --- sigc++/adaptors/hide.h | 5 ++--- sigc++/functors/slot.h | 7 ++++++- sigc++/signal.h | 2 +- sigc++/tuple-utils/tuple_end.h | 2 +- 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 #include #include - #include namespace sigc @@ -230,6 +229,12 @@ public: inline slot() = default; + // If you're tempted to add + // template, 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::type; return bound_mem_functor...) 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>::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> { constexpr auto size = std::tuple_size>::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, len>::type; return start(std::get(std::forward(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>::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>::tuple_start( std::forward(t)); -- cgit v1.2.1