Skip to content

Commit

Permalink
try to fix error
Browse files Browse the repository at this point in the history
  • Loading branch information
p00f committed Oct 19, 2024
1 parent 69263f4 commit 4ddc3fa
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions include/boost/pfr/detail/fields_count.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,14 +180,22 @@ constexpr auto assert_first_not_base(long) noexcept

///////////////////// Helpers for initializable detection
// Note that these take O(N) compile time and memory!
template <class T, std::size_t... I, class /*Enable*/ = std::enable_if_t<std::is_copy_constructible<T>::value>>
template <class T, std::size_t... I, class /*Enable*/ = std::enable_if_t<std::is_copy_constructible<T>::value and !std::is_aggregate_v<T>>>
constexpr auto enable_if_initializable_helper(std::index_sequence<I...>) noexcept
-> std::add_pointer_t<decltype(T{ubiq_lref_constructor{I}...})>;

template <class T, std::size_t... I, class /*Enable*/ = std::enable_if_t<!std::is_copy_constructible<T>::value>>
template <class T, std::size_t... I, class /*Enable*/ = std::enable_if_t<!std::is_copy_constructible<T>::value and !std::is_aggregate_v<T>>>
constexpr auto enable_if_initializable_helper(std::index_sequence<I...>) noexcept
-> std::add_pointer_t<decltype(T{ubiq_rref_constructor{I}...})>;

template <class T, std::size_t... I, class /*Enable*/ = std::enable_if_t<std::is_copy_constructible<T>::value and std::is_aggregate_v<T>>>
constexpr auto enable_if_initializable_helper(std::index_sequence<I...>) noexcept
-> std::add_pointer_t<decltype(T{{ubiq_lref_constructor{I}}...})>;

template <class T, std::size_t... I, class /*Enable*/ = std::enable_if_t<!std::is_copy_constructible<T>::value and std::is_aggregate_v<T>>>
constexpr auto enable_if_initializable_helper(std::index_sequence<I...>) noexcept
-> std::add_pointer_t<decltype(T{{ubiq_rref_constructor{I}}...})>;

template <class T, std::size_t N, class U = std::size_t, class /*Enable*/ = decltype(detail::enable_if_initializable_helper<T>(detail::make_index_sequence<N>()))>
using enable_if_initializable_helper_t = U;

Expand Down

0 comments on commit 4ddc3fa

Please sign in to comment.