2
0
mirror of https://github.com/boostorg/pfr.git synced 2026-01-19 04:22:13 +00:00

Fix build on standards before C++20

This commit is contained in:
Antony Polukhin
2025-05-12 19:34:40 +03:00
parent 8417d4fd2d
commit db9451143a

View File

@@ -13,18 +13,27 @@
#if !defined(BOOST_PFR_INTERFACE_UNIT)
#include <array>
#include <string_view>
#if BOOST_PFR_CORE_NAME_ENABLED
# include <string_view>
#endif
#include <utility> // metaprogramming stuff
#endif
namespace boost { namespace pfr { namespace detail {
#if BOOST_PFR_CORE_NAME_ENABLED
template <class T, std::size_t... I>
constexpr auto make_stdarray_from_tietuple(const T& t, std::index_sequence<I...>) noexcept {
return std::array<std::string_view, sizeof...(I)>{
boost::pfr::detail::sequence_tuple::get<I>(t)...
};
}
#else
template <class T, std::size_t... I>
constexpr auto make_stdarray_from_tietuple(const T&, std::index_sequence<I...>) noexcept {
return nullptr;
}
#endif
}}} // namespace boost::pfr::detail