class Hello2{
public:
void func2(void (*m)(const char *data)){
m("Hello World!");
}
};
int main(const int argc, const char * argv[]) {
Hello2 hello2;
hello2.func2([](const char* data){
std::cout << data << std::endl;
});
return 0;
}
网友评论