Registering isn't a very long operation, so if registering every time you call works for you, it would be a good solution.  I believe the normal registration function would work fine here.  The problem arises with the attempt to EXPORT via a unique identifier.
 
Another way would be to use the text string which is part of typeinfo where RTTI is supported.  Problem is that that creates archive portability problems.
 
Robert Ramey.
"Olivier Vanden Bos" <olivier.vanden-bos@ubisoft.com> wrote in message news:930168C299A0C44D905F4B11995AD74401317BF1@UBIMAIL2.ubisoft.org...

I am not sure of my fact, but can we do it dynamically , as the macro call extended_type_info::self_register() and void extended_type_info::key_register(const char *key_).

 

I ve read in the list some stuff about registering templates like this…

 

 template<class> struct pack;

 

 template<class T> struct pack<void (T)> {

     typedef T type;

 };

 

 BOOST_CLASS_EXPORT( pack<void (DerivedStatus< Algo<int, double > >)>::type );

 

Can we mix that together to achieve this goal ?

In fact, I don’t care if we register the type each time we call, I know it s not optimal , but at this point I can live with it…

 

void Add()

{

      B<int>* objectToAdd= new B<int>(0)

BoostRegister(B<int>);

array.push_back(objectToAdd);

}

 

 

- VDB -                             
 "LNK1210: exceeded internal ILK size limit" 


From: boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org] On Behalf Of Robert Ramey
Sent: 11 mai 2005 02:22
To: boost-users@lists.boost.org
Subject: [Boost-users] Re: Serialize templates classes > automatique exportdeclaration

 

I don't know how to avoid this either.  If you figure out how to do this let me know

 

Robert Ramey

And when i archive the array in another .cpp the exception is raised, because

the class B<int> as not been exported.

 

I would like to avoid explicitly declare

BOOST_CLASS_EXPORT_GUID(B<int>, "B_int")

 

For each instanciation of B<> somewhere in the glo bal space.


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