Skip to content

Instantly share code, notes, and snippets.

@wilhelmtell
Created April 23, 2015 01:04
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 wilhelmtell/e25eb6213740585182da to your computer and use it in GitHub Desktop.
Save wilhelmtell/e25eb6213740585182da to your computer and use it in GitHub Desktop.
#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