diff options
author | Stuart Dootson <stuart.dootson@gmail.com> | 2019-10-24 10:10:24 +0100 |
---|---|---|
committer | Murray Cumming <murrayc@murrayc.com> | 2019-10-25 12:57:31 +0200 |
commit | 858e3daca271162ae1e77fff23693de9f7a0422d (patch) | |
tree | 92b9ecbc5d56a6da1ed66c5ec5adb0b404ab964b | |
parent | e82f0d341b5671ba81734591cc60b7179bc0a3d9 (diff) | |
download | sigc++-858e3daca271162ae1e77fff23693de9f7a0422d.tar.gz |
MSVC build: Add code comments
-rw-r--r-- | sigc++/tuple-utils/tuple_end.h | 1 | ||||
-rw-r--r-- | sigc++/tuple-utils/tuple_for_each.h | 1 | ||||
-rw-r--r-- | sigc++/tuple-utils/tuple_transform_each.h | 2 | ||||
-rw-r--r-- | sigc++/visit_each.h | 1 |
4 files changed, 5 insertions, 0 deletions
diff --git a/sigc++/tuple-utils/tuple_end.h b/sigc++/tuple-utils/tuple_end.h index 72526aa..6c47a34 100644 --- a/sigc++/tuple-utils/tuple_end.h +++ b/sigc++/tuple-utils/tuple_end.h @@ -56,6 +56,7 @@ tuple_end(T&& t) { static_assert(len <= size, "The tuple size must be less than or equal to the length."); if constexpr(len == 0) { + // Prevent 'unreferenced formal parameter' warning from MSVC by 'using' t static_cast<void>(t); // Recursive calls to tuple_cdr() would result in this eventually, // but this avoids the extra work: diff --git a/sigc++/tuple-utils/tuple_for_each.h b/sigc++/tuple-utils/tuple_for_each.h index 8659d65..5296b70 100644 --- a/sigc++/tuple-utils/tuple_for_each.h +++ b/sigc++/tuple-utils/tuple_for_each.h @@ -104,6 +104,7 @@ tuple_for_each(T&& t, T_extras&&... extras) detail::tuple_for_each_impl<T_visitor, size, T_extras...>::tuple_for_each( std::forward<T>(t), std::forward<T_extras>(extras)...); } else { + // Prevent 'unreferenced formal parameter' warning from MSVC by 'using' t static_cast<void>(t); } } diff --git a/sigc++/tuple-utils/tuple_transform_each.h b/sigc++/tuple-utils/tuple_transform_each.h index 8d73764..fa1f7a8 100644 --- a/sigc++/tuple-utils/tuple_transform_each.h +++ b/sigc++/tuple-utils/tuple_transform_each.h @@ -35,6 +35,8 @@ struct tuple_transform_each_impl { static decltype(auto) tuple_transform_each(T_current&& t, T_original& t_original) { if constexpr(size_from_index == 0) { + // Prevent 'unreferenced formal parameter' warning from MSVC by 'using' + // t_original static_cast<void>(t_original); //Do nothing because the tuple has no elements. return std::forward<T_current>(t); diff --git a/sigc++/visit_each.h b/sigc++/visit_each.h index 5f92120..032068a 100644 --- a/sigc++/visit_each.h +++ b/sigc++/visit_each.h @@ -48,6 +48,7 @@ struct limit_trackable_target if constexpr(is_base_of_or_same_v<sigc::trackable, T_type>) { std::invoke(action_, type); } else { + // Prevent 'unreferenced formal parameter' warning from MSVC by 'using' type static_cast<void>(type); } } |