Skip to content

Instantly share code, notes, and snippets.

@telishev
Created January 11, 2016 13:40
Show Gist options
  • Save telishev/a320c802bb5991bf384a to your computer and use it in GitHub Desktop.
Save telishev/a320c802bb5991bf384a to your computer and use it in GitHub Desktop.
#include "Header.h"
const type_info &g () { return C ().func.target_type (); }
#include <functional>
#include <typeinfo>
struct C { std::function<void ()> func = [] {}; C () { } };
const type_info &g ();
#include "Header.h"
#include <stdio.h>
int main ()
{
printf ("%s\n%s\n", C ().func.target_type ().name (), g ().name ());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment