title: how to cast c++ smart pointer up and down
body: <p>two clients communicate to each other on top of a message layer</p>
  
  <p>in the message body, I need include a field pointing to any data type</p>
  
  <p>From client A, I send the field as a <code>shared_ptr&lt;TYPEA&gt;</code> to the message layer.
  I define this field as a <code>shared_ptr&lt;void&gt;</code> in the message layer.
  But how can I convert this field back to <code>shared_ptr&lt;TYPEA&gt;</code> in client B?</p>
  
  <p>Or should I define <code>shared_ptr&lt;void&gt;</code> in message layer as something else?</p>
  
  <p>Thanks</p>