Boost logo

Boost Users :

Subject: [Boost-users] serialization with templates
From: Unger, Jörg F. (joerg.unger_at_[hidden])
Date: 2012-07-12 05:18:56


I'm trying to serialize a template class with multiple template parameters. In the header file, I declare something like

template <int T1, int T2>
class Node
{
private:
std::array<double,T1> first;
std::array<double,T2> second;
}

BOOST_CLASS_EXPORT_KEY(Node<1,1>)

In a separate file, I would use the BOOST_CLASS_EXPORT_IMPLEMENT macro. However, when I'm using the BOOST_CLASS_EXPORT_KEY with a class that has more than one template parameter (as in the example above), I get an error message
Error: macro "BOOST_CLASS_EXPORT_KEY" passed 2 arguments, but takes just 1

I'm using gcc 4.7.1 with boost 50

Any ideas, how to solve that problem?

Jörg F.



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