title: C++ C# delegate Equivalent
body: <p>I will attempt to keep this question as succinct as possible.</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Threading;
  using System.Threading.Tasks;
  using System.Windows.Forms;
  
  namespace Something {
      static class Program {
          [STAThread]
          static void Main() {
              int blah = DoSomethingWithThis( delegate {
                  Console.WriteLine( "Hello World" );
              } );
          }
  
          public static int DoSomethingWithThis( Action del ) {
              del.Invoke(); // Prints Hello World to the console
              int someArbitraryNumber = 31;
              return someArbitraryNumber;
          }
      }
  }
  </code></pre>
  
  <p>In C# I can use an anonymous method as a parameter to do something like this;
  I was wondering if anyone can show me the same thing in C++, or something very similar that would facilitate the same outcome. I plan on using something like the above code to create a DisplayList generator for my game in C++.</p>