Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LiuinStein/d1e7347d4ac1e7ea666009890460c1c6 to your computer and use it in GitHub Desktop.
Save LiuinStein/d1e7347d4ac1e7ea666009890460c1c6 to your computer and use it in GitHub Desktop.
Performs code before the main function has been invoked.
#include <iostream>
static int x = []()
{
std::cout << "x - Performs before main function" << std::endl;
return 0;
}();
class y
{
public:
y()
{
std::cout << "y - Performs before main function" << std::endl;
}
} fuck;
int main()
{
std::cout << "Performs inside main function" << std::endl;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment