title: Passing a math function as method's input parameter C++
body: <p>I am trying to write a general integral function and I would like to implement it in such a way so that it can accept any mathematical function. That is, I would like to pass the math function as an input parameter. In pseudo-code: <code>simpson_int(x*x)</code>. I've heard of the <code>function</code> template in <code>&lt;functional&gt;</code> but I don't really have experience with templates in C++. </p>