Skip to content

Instantly share code, notes, and snippets.

@Elv13
Last active August 29, 2015 14:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Elv13/11265079 to your computer and use it in GitHub Desktop.
Save Elv13/11265079 to your computer and use it in GitHub Desktop.
#include <stdio.h>
#define LAM(type,def,ret) [] () -> type { \
static type bar = def; \
return ret + bar; }\
class A {
public:
constexpr static const auto method = LAM(const int,2,12);
int x;
};
int main() {
A a;
a.x = 1337;
//printf("Uncomment me %d\n",a.method());
return a.x;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment