Skip to content

Instantly share code, notes, and snippets.

@aras-p
Last active September 24, 2019 02:40
Show Gist options
  • Save aras-p/8333398 to your computer and use it in GitHub Desktop.
Save aras-p/8333398 to your computer and use it in GitHub Desktop.
Lambda art
// C++11 lambdas aren't terribly useful at producing art.
// Source below is valid C++11. VS2013 takes about a minute at it (Release config),
// reaches almost 4GB of memory usage and then gives a
//
// 1>ConsoleApplication1.cpp(34): fatal error C1001: An internal error has occurred in the compiler.
// 1> (compiler file 'msc1.cpp', line 1325)
// 1> To work around this problem, try simplifying or changing the program near the locations listed above.
// 1> Please choose the Technical Support command on the Visual C++
// 1> Help menu, or open the Technical Support help file for more information
// 1> This error occurred in injected text:
// 1> :
// ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
//
// With more nested lambdas, it fails with a proper "compiler is out of heap space" error.
int main()
{
[](){
[](){
[](){
[](){
[](){
[](){
[](){
[](){
[](){
[](){
[](){
[](){
[](){
[](){
[](){
[](){
[](){
[](){
[](){
[](){
[](){
[](){
[](){
[](){
[](){
[](){
[](){
[](){
[](){
[](){
[](){
[](){
[](){
[](){
}();
}();
}();
}();
}();
}();
}();
}();
}();
}();
}();
}();
}();
}();
}();
}();
}();
}();
}();
}();
}();
}();
}();
}();
}();
}();
}();
}();
}();
}();
}();
}();
}();
}();
return 0;
}
@x-projs
Copy link

x-projs commented Jan 10, 2014

Interesting, build with VS2013, I got the same result as author.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment