Created
April 23, 2015 01:04
-
-
Save wilhelmtell/e25eb6213740585182da to your computer and use it in GitHub Desktop.
This file contains 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
#include <cmath> | |
int main() { | |
auto const cos = [](auto const& exp) { return [&]() { return std::cos(exp()); }; }; | |
auto const sin = [](auto const& exp) { return [&]() { return std::sin(exp()); }; }; | |
auto const term = [](auto const& x) { return [&]() { return x; }; }; | |
auto const eval = [](auto const& exp) { return exp(); }; | |
std::cout << eval(cos(sin(term(0.5 * M_PI)))) << '\n'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment