-
Notifications
You must be signed in to change notification settings - Fork 83
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
Provide opt-in cv-ref qualifiers forwarding for proxy::invoke #22
Comments
I do not see why this is important. I understand that the signature of
Maybe not. See the following example: struct Foo {
void operator()() { puts("non-const"); }
void operator()() const { puts("const"); }
};
const Foo foo{};
foo(); // prints "const"
std::function<void()> f = foo;
f(); // prints "non-const"
std::as_const(f)(); // prints "non-const"
The
|
That example makes sense to me, thanks. |
You are welcome :)
It is not always true. There is no constraint in the standard that |
Actually, this is a very good question. Before we adopted the design to make |
At present, proxy::invoke is always qualifier free, which makes cv-proxy useless.
The operator() of std::function and std::function_ref is always const and they use qualifiers from underlying object. The operator() of std::move_only_function forwards cv-ref to call underlying object. Existing implementation indicates that forwarding of quals should be an opt-in mechanism.
The text was updated successfully, but these errors were encountered: