Skip to content

Instantly share code, notes, and snippets.

@ridiculousfish
Created January 24, 2017 19:16
Show Gist options
  • Save ridiculousfish/fcdd3dd1a6346c77f18c2116c907640e to your computer and use it in GitHub Desktop.
Save ridiculousfish/fcdd3dd1a6346c77f18c2116c907640e to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <functional>
void func(std::function<void(void)> func) {
printf("func1\n");
}
template<typename ANYTHING>
static void foo() {
func([](){});
}
template<typename HANDLER>
void func(const HANDLER &handler) {
printf("func2\n");
}
int main(void) {
foo<int>();
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment