Skip to content
New issue

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

Interfaces core.hpp and tuple_size.hpp no more has aliases #103

Closed
wants to merge 5 commits into from

Conversation

denzor200
Copy link
Contributor

In C++ we can't make specialization for type alias, but for structure can.
This PR will make #100 possible to implement.

@coveralls
Copy link

coveralls commented Aug 27, 2022

Pull Request Test Coverage Report for Build 2972180814

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 100.0%

Totals Coverage Status
Change from base Build 1768569863: 0.0%
Covered Lines: 337
Relevant Lines: 337

💛 - Coveralls

@apolukhin
Copy link
Member

What is the purpose of specializing those two structures?

@denzor200
Copy link
Contributor Author

What is the purpose of specializing those two structures?

Those two structures are not intended to specialize by library's user(i wrote a note in the docs about it, just now). Ability to specialize will be used by library developers.

@denzor200
Copy link
Contributor Author

denzor200 commented Sep 1, 2022

What is the purpose of specializing those two structures?

It may reduce a lot of code, when i continue integrating pfr into fusion using "VIEW manipulator", like this:

struct A
struct B;
struct C;

BOOST_PFR_REGISTRATE_REFLECTABLE(B)

A a{};
B b{};
C c{};
// boost::fusion::for_each(a, [](auto&&){});                     // won't compile
boost::fusion::for_each(b, [](auto&&){});                        // will use default specialization inside
boost::fusion::for_each(boost::pfr::view(c), [](auto&&){});      // will use `boost::pfr::tuple_size<boost::pfr::view_impl<B>>` specialization inside

See #100 for more detail about BOOST_PFR_REGISTRATE_REFLECTABLE macro and boost::pfr::view manipulator

include/boost/pfr/core.hpp Show resolved Hide resolved
include/boost/pfr/core.hpp Outdated Show resolved Hide resolved
include/boost/pfr/core.hpp Outdated Show resolved Hide resolved
include/boost/pfr/core.hpp Outdated Show resolved Hide resolved
test/run/tuple_like_specializable.cpp Show resolved Hide resolved
@denzor200
Copy link
Contributor Author

Not actual. It may be reopened in the future when we decide that we really need 'boost::pfr::view' or 'boost::pfr::view_fields', but not now.

@denzor200 denzor200 closed this Dec 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants