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

Using any_object with any_scheduler #558

Open
ccotter opened this issue Aug 21, 2023 · 0 comments
Open

Using any_object with any_scheduler #558

ccotter opened this issue Aug 21, 2023 · 0 comments

Comments

@ccotter
Copy link
Contributor

ccotter commented Aug 21, 2023

I tried replacing any_unique_t with any_object_t in any_scheduler to take advantage of the small object optimization, but seem to be hitting some sort of recursion in instantiating the template. any_object instantiates a class invalid_obj which ultimately checks whether each CPO can be invoked. any_scheduler includes the _copy_as CPO which expects any_scheduler to be defined, but finds that any_scheduler is an incomplete type.

any_unique does not have the same invalid_obj class as any_object does.

In https://github.com/facebookexperimental/libunifex/compare/main...ccotter:libunifex:soo-any_scheduler?expand=1, clang and GCC-11 or above compile if I comment out the static_assert(can_be_type_erased_v<invalid_obj>). When the static_assert is added back, these compilers fail with the incomplete type error. GCC-10 fails to compile even with the static_assert commented out.

This godbolt link is also a replication of the error.

cc @lewissbaker

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

No branches or pull requests

1 participant