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

Is the order of support_copy and add_facade crucial? #229

Open
xuruilong100 opened this issue Jan 8, 2025 · 1 comment
Open

Is the order of support_copy and add_facade crucial? #229

xuruilong100 opened this issue Jan 8, 2025 · 1 comment

Comments

@xuruilong100
Copy link

I'm trying sample basic_facade_builder, and I find that

template <class... Overloads>
struct CopyableCallable : pro::facade_builder::                              //
                          support_copy<pro::constraint_level::nontrivial>::  //
                          add_facade<MovableCallable<Overloads...>>::        //
                          build {};

is OK.

But, compiler tells me

template <class... Overloads>
struct CopyableCallable : pro::facade_builder::                              //
                          add_facade<MovableCallable<Overloads...>>::        //
                          support_copy<pro::constraint_level::nontrivial>::  //
                          build {};

is illegal.

@mingxwa
Copy link
Collaborator

mingxwa commented Jan 8, 2025

@xuruilong100 Because the type add_facade<MovableCallable<Overloads...>> depends on template arguments Overloads, C++ requires keywork template to specify an alias template. You need to add template before support_copy to make it compile, or simply swapping add_facade and support_copy should also work (as you already tried).

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

2 participants