title: How to create a macro for a templated function in c++
body: <p>I want to create a macro for a template function<br>
  something on the lines of   </p>
  
  <pre><code>#define CHECK_MIN(T)(value, target) checkmin(T value, T target) \
  checkmin&lt;T&gt;(T val, T target, __FUNCTION__, __LINE__)
  
  template&lt;typename T&gt; checkmin(T val, T target, const char* functionName, long lineNumber)
  {
      // Check if the val is less than target
      // Construct a std::string using the function name and line name
      // throw std:: exception passing the string constructed above.
  }
  </code></pre>
  
  <p>I am not able to get the syntax to achieve this. Any ideas? </p>