Skip to content

Instantly share code, notes, and snippets.

@ridiculousfish
Created May 4, 2020 01:15
Show Gist options
  • Save ridiculousfish/bc7a6616e504970b89d91b29c296a469 to your computer and use it in GitHub Desktop.
Save ridiculousfish/bc7a6616e504970b89d91b29c296a469 to your computer and use it in GitHub Desktop.
extern "C" int pthread_once(int *, void());
int a(int *c, void __func()) { return pthread_once(c, __func); }
namespace b {
struct A {
int e;
};
extern "C" void __once_proxy();
template < typename f > void d(A &c, f ) { a(&c.e, __once_proxy); }
}
void h();
main() {
b::A g;
d(g, h);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment