Last active
September 24, 2019 02:40
-
-
Save aras-p/8333398 to your computer and use it in GitHub Desktop.
Lambda art
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Interesting, build with VS2013, I got the same result as author.