title: Loading a class from XML with boost serialization
body: <p>I'm trying to load a simple class from a XML file but getting the following error:</p>
  
  <pre><code>error: no match for 'operator&gt;&gt;' in 'xml &gt;&gt; boost::serialization::make_nvp(const
  char*, T&amp;) [with T = Options](((Options&amp;)(&amp; o)))'
  </code></pre>
  
  <p>It must be something stupid I'm doing wrong, but I can't figure out what. Does someone have an idea? Here's my code:</p>
  
  <pre><code>#include &lt;fstream&gt;
  #include &lt;boost/serialization/string.hpp&gt;
  #include &lt;boost/serialization/map.hpp&gt;
  #include &lt;boost/archive/xml_oarchive.hpp&gt;
  #include &lt;boost/serialization/nvp.hpp&gt;
  
  class Options {
  public:
      Options() {
          SetInteger("screenWidth", 1024);
          SetInteger("screenHeight", 768);
      }
      void SetInteger(const std::string&amp; name, int value) {
          integers_[name] = value;
      }
  private:
      std::map&lt;std::string, int&gt; integers_;
  
      friend class boost::serialization::access;
      template&lt;class archive&gt;
      void serialize(archive&amp; ar, const unsigned int version)
      {
          using boost::serialization::make_nvp;
          ar &amp; make_nvp("integers", integers_);
      }
  };
  
  int main() {
      Options o;
      std::ofstream ifs("input.xml");
      boost::archive::xml_oarchive xml(ifs);
      xml &gt;&gt; boost::serialization::make_nvp("options", o); // error
  }
  </code></pre>