title: should I use std::any for std::shared_ptr<void>?
body: <p>I have several <code>producers</code> and one <code>consumer</code> which hold a <code>queue</code>, when producer produce an object, it wrap it into a <code>shared_ptr</code> and send to consumer queue for processing, because different producer may produce different type of object, so the queue is defined as</p>
  <pre><code>struct FrameHeader {
      int data_type;
  };
  
  class Frame {
  private:
      std::shared_ptr&lt;FrameHeader&gt; header;
      std::shared_ptr&lt;void&gt; body;
  public:
      Frame(const std::shared_ptr&lt;FrameHeader&gt; header, const std::shared_ptr&lt;void&gt; body);
      std::shared_ptr&lt;FrameHeader&gt; get_header();
      std::shared_ptr&lt;void&gt; get_body();
  };
  
  std::deque&lt;std::shared_ptr&lt;Frame&gt;&gt; data_q;
  </code></pre>
  <p>when I pop an <code>Frame</code> from <code>data_q</code>, I look into to <code>data_type</code> field in <code>header</code> to decide which object I should cast the <code>body</code> into</p>
  <p>May question is with <code>c++17</code> I learnt there is a new feature called <code>std::any</code> that I can use to hold any object, should I use <code>any</code> in place of <code>shared_ptr&lt;void&gt;</code> like this?</p>
  <pre><code>    class Frame {
      private:
          std::shared_ptr&lt;FrameHeader&gt; header;
          any body;
      public:
          Frame(const std::shared_ptr&lt;FrameHeader&gt; header, const std::shared_ptr&lt;void&gt; body);
          std::shared_ptr&lt;FrameHeader&gt; get_header();
          any get_body();
      };
  
  ...
  auto real_obj_ptr = any_cast&lt;shared_ptr&lt;RealClass&gt;&gt;(frame.get_body());
  </code></pre>
  <p>Also if there is better way of handling this situation?</p>