title: How to make an "operator" variable? (C++)
body: <p>I am working on making an expression class:</p>
  
  <pre><code>template&lt;typename T, typename U&gt;
  class expression
  {
  public:
      expression(T vala, U valb, oper o){val1 = vala; val2 = valb; op = o;}
      operator bool{return(val1 op val2);}
  private:
      T val1;
      U val2;
      oper op;
  };
  </code></pre>
  
  <p>as you can see, this is somewhat pseudocode, because I need an operator class.  My original thought was to create an array of all possible operators, and then convert it through a string, but that wouldn't work because of the sheer number of operators, and how to convert it to a string except through a two dimensional array, where n[0][0] has the first operator, and n[0][1] has that operators string.</p>
  
  <p>Does anybody have any suggestions to adding an operator value to my expression class?</p>