// Copyright (c) 2016-2025 Antony Polukhin // Copyright (c) 2025 Jean-Michaƫl Celerier // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // boost-no-inspect #ifndef BOOST_PFR_DETAIL_CORE26_HPP #define BOOST_PFR_DETAIL_CORE26_HPP #pragma once #include namespace boost::pfr::detail { template constexpr auto tie_as_tuple(T &val) noexcept { static_assert(!std::is_union::value, "====================> Boost.PFR: For safety reasons it is forbidden to reflect " "unions. See `Reflection of unions` section in the docs for more info."); auto &&[... members] = std::forward(val); return sequence_tuple::tuple...>{members...}; } template constexpr void for_each_field_dispatcher(T& t, F&& f, std::index_sequence) { static_assert( !std::is_union::value, "====================> Boost.PFR: For safety reasons it is forbidden to reflect unions. See `Reflection of unions` section in the docs for more info." ); std::forward(f)( detail::tie_as_tuple(t) ); } } // namespace boost::pfr::detail #endif