Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
serialization with templates
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
 
View profile  
 More options Jul 12 2012, 5:18 am
From: Unger, Jörg F. <joerg.un...@bam.de>
Date: Thu, 12 Jul 2012 09:18:56 +0000
Local: Thurs, Jul 12 2012 5:18 am
Subject: [Boost-users] serialization with templates

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 mailing list
Boost-us...@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
niXman  
View profile  
 More options Jul 12 2012, 10:27 am
From: niXman <i.nix...@gmail.com>
Date: Thu, 12 Jul 2012 18:27:21 +0400
Local: Thurs, Jul 12 2012 10:27 am
Subject: Re: [Boost-users] serialization with templates
2012/7/12 Unger, Jörg F.:

> BOOST_CLASS_EXPORT_KEY(Node<1,1>)

-

#include <boost/utility/identity_type.hpp>

BOOST_CLASS_EXPORT_KEY(BOOST_IDENTITY_TYPE((Node<1,1>)))

--
Regards,
niXman
___________________________________________________
Dual-target(32 & 64 bit) MinGW compilers for 32 and 64 bit Windows:
http://sourceforge.net/projects/mingwbuilds/
_______________________________________________
Boost-users mailing list
Boost-us...@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
viatcheslav.sysolt...@h-d-gmbh.de  
View profile  
 More options Jul 12 2012, 10:27 am
From: Viatcheslav.Sysolt...@h-d-gmbh.de
Date: Thu, 12 Jul 2012 16:27:23 +0200
Local: Thurs, Jul 12 2012 10:27 am
Subject: Re: [Boost-users] serialization with templates
On Thu, 12 Jul 2012 11:18:56 +0200, Unger, Jörg F. <joerg.un...@bam.de>  
wrote:

Hi,

My boost 1.47 does not have BOOST_CLASS_EXPORT_KEY but I suppose this is a  
macro, therefore there is a problem with comma in template. Try to use  
typedef or maybe BOOST_PP_COMMA may help here.

-- Slava

_______________________________________________
Boost-users mailing list
Boost-us...@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »