title: Legit way to store a destructor information to a void*
body: <p>Is it legit to store the delete information of a void pointer in a function pointer like this?</p>
  
  <pre><code>typedef void(*deleter)(void*);
  template &lt;class T&gt; void deleteVoidPointer(void* target)
  {
      delete static_cast&lt;T*&gt;(target);
  }
  
  int main()
  {
      void* p = new int;
      deleter del = deleteVoidPointer&lt;int&gt;;
  
      del(p);
      return 0;
  }
  </code></pre>
  
  <p>Are there any side effects I am missing here or is this a legit way to keep track of destructor information for a pointer? (Besides the missing check if target is a nullptr in deleteVoidPointer)</p>