title: How cast char symbol "+" directly to an operation + (addition) ? C++
body: <p>Here is the issue, I have a <code>char</code> symbol:</p>
  <pre><code>char a = '+'; //- * % whatever arithmetic symbol 
  </code></pre>
  <p>I want so that I could use the value of <code>a</code> as an operation. I don't want to use a <code>switch</code> to check if <code>a</code> is <code>'+'</code>, etc, and then write a lot of similar lines for each <code>case</code>. I need just to change the operation, depending on the value of <code>a</code>:</p>
  <pre><code>int b = 2a2; //b=4 if a = &quot;+&quot;, b = 0 if a = &quot;-&quot; etc
  </code></pre>
  <p>But I don't know how to cast the <code>char</code> to an operation quickly. C++ has <code>stoi()</code> to cast a string to an integer, but how to cast a <code>char</code> to an operation?</p>
  <p>By the way, which type of data is <code>+</code>? In expression like <code>2+2</code>, <code>2</code> is an integer, but what is <code>+</code>? Is it a method or what?</p>