title: Retrieve typeid of shared_ptr deleter?
body: <p>(For background info, it <em>might</em> help to read <a href="https://stackoverflow.com/questions/38180899/shared-ptr-without-rtti">shared_ptr without RTTI?</a> first. Or it might not.)</p>
  
  <p>I'm looking at the interface for <code>shared_ptr</code> out of curiosity — that is, this question is <em>not</em> motivated by a real use-case, but just questioning whether I'm missing something. I see that <code>shared_ptr</code> does type-erasure of its deleter, similarly to <code>std::any</code> and <code>std::function</code>. In the latter two cases the Standard always gives us a pair of type-<em>unerasure</em> functions: one that tells the exact <code>typeid</code> of the erased object, and one that reveals the original object iff we can guess its original type at compile time (and if not, <a href="https://en.wikipedia.org/wiki/Go_Fish#The_game" rel="nofollow noreferrer">"go fish!"</a>).</p>
  
  <pre><code>int xx = 42;
  using Type = decltype(xx);
  std::any a = xx;
  assert( a.type() == typeid(Type) );
  assert( std::any_cast&lt;Type&gt;(a) == 42 );
  
  int (*xx)() = +[]() { return 42; };
  using Type = decltype(xx);
  std::function&lt;long()&gt; f = xx;
  assert( f.target_type() == typeid(Type) );
  assert( *f.target&lt;Type&gt;() == xx );
  
  void (*xx)(int *) = +[](int *x) { delete x; };
  using Type = decltype(xx);
  std::shared_ptr&lt;int&gt; p(new int, xx);
  /* assert( ??? == typeid(Type) ); */
  assert( *std::get_deleter&lt;Type&gt;(p) == xx );
  </code></pre>
  
  <p>The crazy different spellings of these type-unerasure accessors I take as par for the course. What really surprises me, though, is that there doesn't seem to be any "get the <code>typeid</code>" accessor for <code>shared_ptr</code>! Am I just missing something on cppreference? Or is there a technical reason this particular function would be difficult to provide? Or is it just a random hole in the specification of <code>shared_ptr</code>, i.e., historical reasons?</p>
  
  <p>(Again, I can't think of any use-case for this, and IMHO it would be preferable if neither <code>function</code> nor <code>shared_ptr</code> allowed type-unerasure at all; but since they <em>do</em>, I'm wondering why it's so dang inconsistent.)</p>