Boost logo

Boost Users :

From: Bruno Martínez (br1_at_[hidden])
Date: 2005-09-09 11:12:21


On Thu, 08 Sep 2005 12:58:37 -0300, Robert Ramey <ramey_at_[hidden]> wrote:

> OK - I think I understand you now.
>
> a) we don't know all the derived classes so we can't use "register"
> b) BOOST_CLASS_EXPORT doesn't work with templates.
> c) An attempt to use the underlying defintion of BOOST_CLASS_EXPORT fails
> because each class needs its own distinct name and we don't have a
> portable
> way of automatically generating something like:
>
> "my_class<int>" from class<T> when T == int
>
> So we have to make a new export invocation by hand for each template
> instantiation. This gets us back to square one in that we don't know
> apriori all the types that will be used as template parameters.

Maybe this would be possible if we could ask the serialization lib itself
for info about int. Two classes my_class<T1> and my_class<T2> would be
ordered the same way than T1 and T2 are. It would be like subregistration.

> I don't have a general solution for this.
>
> In the longer term it might be solvable in general. This problem has
> been
> discussed in some detail from time to time.

Could you please find the links to these conversations? I've been
unsuccesful.

> In the shorter term you could
> probably craft a solution that would not be a general solution but might
> work in some cases. If you don't care about archive portability - that
> is
> if your only loading archives with the same compiler (and probably
> standard
> library), you could craft something which would generate a uniquename
> from
> type_id.

This is the route that I'm going to take. I'll try to understand how the
underlyings of BOOST_CLASS_EXPORT work.

Regards,
Bruno Martínez


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