Back To The Future as Code

David Amador twitted about this cool site Movies as Code and I decided to make a simple entry for Back To The Future as C++. Here is my entry: http://moviesascode.net/adventure/back-to-the-future-2/

The code doesn’t appear correctly on that site so here it is the full version:

#include <future>
#include <iostream>

int main()
{
  auto future = std::async([] { return "Future"; });
  std::cout << "Back To The " << future.get() << std::endl;
  return 0;
}

For those who didn’t get it: C++11 added a new feature that is used in the sample called “future” that will hold the result of an async function somewhere in the future. It was just to play around with the name of that feature 🙂

Tagged , , , . Bookmark the permalink.

2 Responses to Back To The Future as Code

  1. Ben Howdle says:

    All fixed now. I’m battling with WordPress code submissions.

  2. n0n4m3 says:

    Cool! Thanks 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *