title: What is the right way to put objects to boost::property_tree?
body: <p>Consider following example:</p>
  
  <pre><code>#include &lt;boost\property_tree\ptree.hpp&gt;
  #include &lt;boost/any.hpp&gt;
  
  typedef boost::property_tree::ptree PT;
  
  struct Foo
  {
      int bar;
      int egg;
      Foo(): bar(), egg() {}
  };
  
  
  int main()
  {
      Foo foo;
      foo.bar = 5;
      PT pt;
      pt.put&lt;Foo&gt;("foo", foo);
      return 0;
  }
  </code></pre>
  
  <p>I'm new to boost and I'm willing to put a Foo object into property tree. The example above will not compile giving an error:</p>
  
  <p><code>c:\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/boost/property_tree/stream_translator.hpp:33:13: error: no match for 'operator&lt;&lt;' in 's &lt;&lt; e'</code></p>
  
  <p>Can anyone suggest the right way to do it?</p>