Skip to content

stub 函数可以是 std::function 或 lambda 吗 #44

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

Open
HighVorz opened this issue Feb 24, 2025 · 1 comment
Open

stub 函数可以是 std::function 或 lambda 吗 #44

HighVorz opened this issue Feb 24, 2025 · 1 comment

Comments

@HighVorz
Copy link

void func(int a) {}

int main () {
std::function f = [] (int a) {} ;
stub.set(func, f); // 类似这样的调用?
}

@coolxv
Copy link
Owner

coolxv commented Mar 10, 2025

可以,只要[]没有捕获参数。

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