Skip to content

Commit 858e3da

Browse files
studootmurraycu
authored andcommitted
MSVC build: Add code comments
1 parent e82f0d3 commit 858e3da

File tree

4 files changed

+5
-0
lines changed

4 files changed

+5
-0
lines changed

sigc++/tuple-utils/tuple_end.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ tuple_end(T&& t) {
5656
static_assert(len <= size, "The tuple size must be less than or equal to the length.");
5757

5858
if constexpr(len == 0) {
59+
// Prevent 'unreferenced formal parameter' warning from MSVC by 'using' t
5960
static_cast<void>(t);
6061
// Recursive calls to tuple_cdr() would result in this eventually,
6162
// but this avoids the extra work:

sigc++/tuple-utils/tuple_for_each.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ tuple_for_each(T&& t, T_extras&&... extras)
104104
detail::tuple_for_each_impl<T_visitor, size, T_extras...>::tuple_for_each(
105105
std::forward<T>(t), std::forward<T_extras>(extras)...);
106106
} else {
107+
// Prevent 'unreferenced formal parameter' warning from MSVC by 'using' t
107108
static_cast<void>(t);
108109
}
109110
}

sigc++/tuple-utils/tuple_transform_each.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ struct tuple_transform_each_impl {
3535
static decltype(auto)
3636
tuple_transform_each(T_current&& t, T_original& t_original) {
3737
if constexpr(size_from_index == 0) {
38+
// Prevent 'unreferenced formal parameter' warning from MSVC by 'using'
39+
// t_original
3840
static_cast<void>(t_original);
3941
//Do nothing because the tuple has no elements.
4042
return std::forward<T_current>(t);

sigc++/visit_each.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ struct limit_trackable_target
4848
if constexpr(is_base_of_or_same_v<sigc::trackable, T_type>) {
4949
std::invoke(action_, type);
5050
} else {
51+
// Prevent 'unreferenced formal parameter' warning from MSVC by 'using' type
5152
static_cast<void>(type);
5253
}
5354
}

0 commit comments

Comments
 (0)