Boost logo

Boost Users :

From: Sohail Somani (s.somani_at_[hidden])
Date: 2007-04-27 22:58:04


Oh I didn't mean to suggest that was within a template. Just would be nice to be able to use BOOST_CLASS_EXPORT for instantiated class templates as well.

/me remembers not to use T in a non-template context again

-----Original Message-----
From: boost-users-bounces_at_[hidden] on behalf of Robert Ramey
Sent: Fri 4/27/2007 6:51 PM
To: boost-users_at_[hidden]
Subject: Re: [Boost-users] [Serialization] xml_archive + templates = :-(
 
The macro can't work with templates even if the xml syntax
issue were resolved.

One has to use

BOOST_EXPORT_CLASS_GUID(Something<MyThing>,"Something_MyThing"); // works
\o/

This is because the GUID has to be different for each class. They can't ll
be
"Something_T"

Robert Ramey

Sohail Somani wrote:
> Hi,
>
> Quite sensibly, xml_archive seems to fail with archive errors when
> class_name contains xml characters (like <) which are quite common in
> templates. For example, in my tests:
>
> BOOST_EXPORT_CLASS(Something<T>); // fails when deserializing because
> of parse error.
>
> I fix it by doing:
>
> BOOST_EXPORT_CLASS_GUID(Something<T>,"Something_T"); // works \o/
>
> Now, do you suppose xml_archive could be smart enough to convert < to
> &lt; and similarly for other prohibited characters when serializing?
> Even if not, is there something I can do in 1.33.1 that would make it
> not so redundant?
>
> Thanks,
>
> Sohail

_______________________________________________
Boost-users mailing list
Boost-users_at_[hidden]
http://lists.boost.org/mailman/listinfo.cgi/boost-users



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