title: Compile time check if a function is used/unused c++
body: <p>I'd like to check during compile time if some function of <em>some class</em> is used/not used, and accordingly fail/pass the compilation process.</p>
  
  <p>For example if function <code>F1</code> is called somewhere in the code I want the compilation to succeed, and if function <code>F2</code> is called I want it to fail.</p>
  
  <p>Any ideas on how to do that, with usage of preprocessor, templates or any other c++ metaprogramming technique?</p>