Skip to content

Commit

Permalink
Workaround MSVC bogus warning (fixes #167)
Browse files Browse the repository at this point in the history
  • Loading branch information
apolukhin committed Apr 1, 2024
1 parent 5f857d5 commit 449bf36
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions include/boost/pfr/detail/stdtuple.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,23 @@ namespace boost { namespace pfr { namespace detail {

template <class T, std::size_t... I>
constexpr auto make_stdtuple_from_tietuple(const T& t, std::index_sequence<I...>) {
(void)t; // workaround for MSVC 14.1 `warning C4100: 't': unreferenced formal parameter`
return std::make_tuple(
boost::pfr::detail::sequence_tuple::get<I>(t)...
);
}

template <class T, std::size_t... I>
constexpr auto make_stdtiedtuple_from_tietuple(const T& t, std::index_sequence<I...>) noexcept {
(void)t; // workaround for MSVC 14.1 `warning C4100: 't': unreferenced formal parameter`
return std::tie(
boost::pfr::detail::sequence_tuple::get<I>(t)...
);
}

template <class T, std::size_t... I>
constexpr auto make_conststdtiedtuple_from_tietuple(const T& t, std::index_sequence<I...>) noexcept {
(void)t; // workaround for MSVC 14.1 `warning C4100: 't': unreferenced formal parameter`
return std::tuple<
std::add_lvalue_reference_t<std::add_const_t<
std::remove_reference_t<decltype(boost::pfr::detail::sequence_tuple::get<I>(t))>
Expand Down

0 comments on commit 449bf36

Please sign in to comment.