title: Can I make a table of String + lambdas that have the same signature?
body: <p>I have this pattern:</p>
  
  <pre><code>Thing * y = FindNearestItem();
  if (y &amp;&amp; (MenuElement * x = FindMenuElementNamed("Identity")))
    x-&gt;SetText(FString("%.1f", y));
  else if (x)
    x-&gt;Clear();
  if (y &amp;&amp; (MenuElement * x = FindMenuElementNamed("X1")))
    x-&gt;SetLocalData(y);
  else if (x)
    x-&gt;Clear();
  </code></pre>
  
  <p>Basically, I want to use a static table:
  [WARNING: really sloppy conceptual code, not valid, I'm a noob, you've been warned]:</p>
  
  <pre><code>struct Table {
    const char * label;
    ?lambda? lambda;
  } MyTable[] = {
    "Identity", [] (const char * label, Thing * y) { MenuElement * x = FindMenuElementNamed(label); (y &amp;&amp; x) ? x-&gt;SetText(FString("%.1f", y)) : x-&gt;Clear(); },
    "X1", [] (const char * label, Thing * y) { MenuElement * x = FindMenuElementNamed(label); (y &amp;&amp; x) ? x-&gt;SetLocalData(y) : x-&gt;Clear(); },
  };
  
  Thing * y = FindNearestItem();
  for (int i = 0; i != countof(MyTable); ++i)
    MyTable[i].lambda(MyTable[i].label, y);
  </code></pre>
  
  <p>PLEASE keep in mind that that the action differs for each label - each row in my table.</p>
  
  <p>So the pattern is mostly the same, but the variance is in the action taken, though it uses the same set of data (x,y,label) in each case.  But I cannot simply call x->DoAppropriateThingFor(label,y);  I'd just be back to creating a long if/else cascade based on label...</p>
  
  <p>Feel free to ask me for further clarification.  I'm muddling around in the dark with lambdas since I've not had a chance to really use them yet...</p>