|
Boost Users : |
Subject: Re: [Boost-users] (no subject)
From: Robert Ramey (ramey_at_[hidden])
Date: 2016-02-24 11:22:29
On 2/24/16 1:29 AM, ÐикÑоÑÐ¸Ñ Ðоможакова wrote:
> 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?
try extra parenthesis
> ar &
BOOST_SERIALIZATION_BASE_OBJECT_NVP((AverDayVisMathTask<T>));
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