title: Retrieve current class type during compile time in C++
body: <p>Is it possible to create a C++ macro that - if called within the method of a class - accepts a <code>void*</code> value and casts it into the current class type?</p>
  
  <pre><code>class Foo{
    void bar();
    void baz(){ void* pInst = some_magic_source(); SOME_MACRO(pInst)-&gt;bar(); }
  };
  </code></pre>
  
  <p>The solution should work with VC++ 2012+ and GCC 4.8+.</p>
  
  <p>(I need this as a part of a more complex macro)</p>