mirror of
https://github.com/boostorg/pfr.git
synced 2026-01-19 04:22:13 +00:00
Fix for old MSVC compiler
This commit is contained in:
@@ -21,7 +21,6 @@
|
||||
#include <boost/pfr/detail/make_integer_sequence.hpp>
|
||||
|
||||
#include <cstddef> // for std::size_t
|
||||
#include <type_traits> // for std::enable_if_t
|
||||
|
||||
#include <boost/pfr/tuple_size.hpp>
|
||||
|
||||
@@ -75,24 +74,14 @@ std::array<std::string_view, boost::pfr::tuple_size_v<T>>
|
||||
#else
|
||||
auto
|
||||
#endif
|
||||
names_as_array(
|
||||
#ifndef BOOST_PFR_DOXYGEN_INVOKED
|
||||
std::enable_if_t<!decltype(detail::tie_as_names_tuple<T>())::empty()>* = nullptr
|
||||
#endif
|
||||
) noexcept {
|
||||
names_as_array() noexcept {
|
||||
return detail::make_stdarray_from_tietuple(
|
||||
detail::tie_as_names_tuple<T>(),
|
||||
detail::make_index_sequence< tuple_size_v<T> >()
|
||||
detail::make_index_sequence< tuple_size_v<T> >(),
|
||||
1L
|
||||
);
|
||||
}
|
||||
|
||||
#ifndef BOOST_PFR_DOXYGEN_INVOKED
|
||||
template <class T>
|
||||
constexpr auto names_as_array(std::enable_if_t<decltype(detail::tie_as_names_tuple<T>())::empty()>* = nullptr) noexcept {
|
||||
return detail::make_empty_stdarray();
|
||||
}
|
||||
#endif
|
||||
|
||||
}} // namespace boost::pfr
|
||||
|
||||
#endif // BOOST_PFR_CORE_NAME_HPP
|
||||
|
||||
@@ -24,13 +24,14 @@ constexpr auto make_stdarray(const Types&... t) noexcept {
|
||||
}
|
||||
|
||||
template <class T, std::size_t... I>
|
||||
constexpr auto make_stdarray_from_tietuple(const T& t, std::index_sequence<I...>) noexcept {
|
||||
constexpr auto make_stdarray_from_tietuple(const T& t, std::index_sequence<I...>, int) noexcept {
|
||||
return detail::make_stdarray(
|
||||
boost::pfr::detail::sequence_tuple::get<I>(t)...
|
||||
);
|
||||
}
|
||||
|
||||
constexpr auto make_empty_stdarray() noexcept {
|
||||
template <class T>
|
||||
constexpr auto make_stdarray_from_tietuple(const T& t, std::index_sequence<>, long) noexcept {
|
||||
return std::array<std::nullptr_t, 0>{};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user