title: How to de/serialize a map with template class using boost::multiprecision::mpq_rational
body: <p>I have the following template class:</p>
  
  <pre><code>#include &lt;map&gt;
  #include &lt;boost/array.hpp&gt;
  #include &lt;boost/serialization/map.hpp&gt;
  #include &lt;boost/serialization/serialization.hpp&gt;
  #include &lt;boost/archive/text_iarchive.hpp&gt;
  #include &lt;boost/archive/text_oarchive.hpp&gt;
  #include &lt;boost/multiprecision/gmp.hpp&gt;
  template &lt;class T&gt;
  class A {
  friend class boost::serialization::access;
  template&lt;class Archive&gt;
  void serialize(Archive &amp; ar, const unsigned int version)
  {
          ar &amp; a;
  }
  public:
    T a;
  };
  </code></pre>
  
  <p>that I use to create a map. </p>
  
  <pre><code>map&lt;A&lt;boost::array&lt;int,2&gt; &gt;, int&gt; mmm;
  </code></pre>
  
  <p>I can use the header files provided by boost to serialize/deserialize this code using:</p>
  
  <pre><code> ifstream ifs("filename");
   boost::archive::text_iarchive iarch(ifs);
   boost::serialization::load&lt;boost::archive::text_iarchive,int,A&lt;boost::array&lt;int,2&gt; &gt; &gt;(iarch,mmm,1);
  </code></pre>
  
  <p>Question: I would like to use <code>boost::multiprecision::mpq_rational</code> instead of <code>int</code> inside the array. However I get a long error with the main complaint being that gmp_backend does not have a serialize method:</p>
  
  <pre><code>....
  /usr/local/include/boost/serialization/access.hpp:118:9: error: ‘struct boost::multiprecision::backends::gmp_rational’ has no member named ‘serialize’
       t.serialize(ar, file_version);
       ^
  </code></pre>
  
  <p>Is there an easy fix using boost/serialization/map.hpp with mpq_rational?
  Thanks,</p>