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

[concept.regularinvocable] Adding examples for regular_invocable would be helpful #3479

Open
morinmorin opened this issue Nov 16, 2019 · 0 comments

Comments

@morinmorin
Copy link
Contributor

It would be very helpful to having examples on what is allowed in regular_invocable.

Here is a draft:

int g;
int f1(int* p, int& r) { // regular_invocable
    ++g;
    ++*p;
    // r is not modified
    return 0;
}
int f2(int* p, int& r) { // not regular_invocable
    ++r;
    return 0;
}
struct F {
    mutable int m;
    int* p;
    int& r;
    int operator()() const { // regular_invocable
        ++m;
        ++*p;
        ++r;
        return 0;
    }
};

Please note that I do not understand regular_invocable well (so I request to add examples ;) ) and the regular_invocable/non-regular_invocable distinction may be incorrest.

This is related to GB206 (cplusplus/nbballot#204).

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