how to wrap a binary operator using modern C++ instead of macros : <p>I saw a macro wrapper for binary operator on <a href="http://craftinginterpreters.com/a-virtual-machine.html" rel="nofollow noreferrer">this site</a> like this:</p>

<pre><code>#define BINARY_OP(op) \                                          
  do { \                                                       
    double b = pop(); \                                        
    double a = pop(); \                                        
    push(a op b); \                                            
    } while (false)
</code></pre>

<p>and it's used like this:</p>

<pre><code>switch(op){
  case OP_ADD:      BINARY_OP(+); break;
  case OP_SUBTRACT: BINARY_OP(-); break;
  case OP_MULTIPLY: BINARY_OP(*); break;
  case OP_DIVIDE:   BINARY_OP(/); break;
  // other ops...
}
</code></pre>

<p>but can I use a modern C++ way to implement such a wrapper instead of a macro?</p>
