We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reproduce:
struct Foo { int x[2]; };
gcc: 13.2.0 compile command: g++ -std=c++20 a.cpp -Ipath/to/boost
g++ -std=c++20 a.cpp -Ipath/to/boost
Expect: expects(boost::pfr::tuple_size_v<Foo> == 1); Actual: boost::pfr::tuple_size_v<Foo> == 2
expects(boost::pfr::tuple_size_v<Foo> == 1);
boost::pfr::tuple_size_v<Foo> == 2
Workaround(might be problematic, but works for me):
diff --git a/include/boost/pfr/detail/fields_count.hpp b/include/boost/pfr/detail/fields_count.hpp index 8d1354e..04bb89c 100644 --- a/include/boost/pfr/detail/fields_count.hpp +++ b/include/boost/pfr/detail/fields_count.hpp @@ -150,11 +150,11 @@ constexpr void* assert_first_not_base(std::index_sequence<>) noexcept ///////////////////// Helper for SFINAE on fields count template <class T, std::size_t... I, class /*Enable*/ = typename std::enable_if<std::is_copy_constructible<T>::value>::type> constexpr auto enable_if_constructible_helper(std::index_sequence<I...>) noexcept - -> typename std::add_pointer<decltype(T{ ubiq_lref_constructor{I}... })>::type; + -> typename std::add_pointer<decltype(T{ {ubiq_lref_constructor{I}}... })>::type; template <class T, std::size_t... I, class /*Enable*/ = typename std::enable_if<!std::is_copy_constructible<T>::value>::type> constexpr auto enable_if_constructible_helper(std::index_sequence<I...>) noexcept - -> typename std::add_pointer<decltype(T{ ubiq_rref_constructor{I}... })>::type; + -> typename std::add_pointer<decltype(T{ {ubiq_rref_constructor{I}}... })>::type; template <class T, std::size_t N, class /*Enable*/ = decltype( enable_if_constructible_helper<T>(detail::make_index_sequence<N>()) ) > using enable_if_constructible_helper_t = std::size_t;
The text was updated successfully, but these errors were encountered:
The patch breaks multiple tests. It requires some additional tweaking, I'd appreciate a PR.
Sorry, something went wrong.
No branches or pull requests
Reproduce:
gcc: 13.2.0
compile command:
g++ -std=c++20 a.cpp -Ipath/to/boost
Expect:
expects(boost::pfr::tuple_size_v<Foo> == 1);
Actual:
boost::pfr::tuple_size_v<Foo> == 2
Workaround(might be problematic, but works for me):
The text was updated successfully, but these errors were encountered: