Boost logo

Boost Users :

Subject: [Boost-users] (no subject)
From: Виктория Доможакова (viktoriyabuzanova_at_[hidden])
Date: 2016-02-24 04:29:16


 Hello. I have template class.
I want to serialize it. But I don't know how.

template <class T>
class AverDayVisTask : public DrawTask, public AverDayVisMathTask <T> {
  public:
    // some functions

  private:
    friend class boost::serialization::access;

    //! boost::serialize
    template <class Archive>
    void serialize(Archive& ar, const unsigned int /*version*/) {
      ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(DrawTask);
      ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(AverDayVisMathTask<T>); //<----- error
    }

}; // class AverDayVisTask

BOOST_CLASS_VERSION(AverDayVisTask<SphericalModel>, 1);
BOOST_CLASS_VERSION(AverDayVisTask<SphericalNutModel>, 1);
BOOST_CLASS_VERSION(AverDayVisTask<WGS84Model>, 1);
BOOST_CLASS_IMPLEMENTATION(AverDayVisTask<SphericalModel>, boost::serialization::object_class_info);
BOOST_CLASS_IMPLEMENTATION(AverDayVisTask<SphericalNutModel>, boost::serialization::object_class_info);
BOOST_CLASS_IMPLEMENTATION(AverDayVisTask<WGS84Model>, boost::serialization::object_class_info);

How fix my problem?

-- 
Виктория Доможакова


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net