title: How to replace a function pointer with a template parameter or a std::function?
body: <p>I run a sonarlint plugin in visualstudio.
  I get a major problem about my code as below :</p>
  <pre><code>_declspec(dllexport) void GetInformation(void (add)(const char* pCarName))
  {
      add(&quot;N3-988&quot;);
      add(&quot;N3-40&quot;);
      add(&quot;N3-41&quot;);
      add(&quot;N3-428&quot;);
  }
  </code></pre>
  <p>The error is</p>
  <pre><code>cpp:S5205 : Replace this function pointer with a template parameter or a &quot;std::function&quot;.
  </code></pre>
  <p>How to fix it ?</p>