Boost logo

Boost Users :

From: Bruno Martínez (br1_at_[hidden])
Date: 2005-11-28 07:42:07


On Mon, 28 Nov 2005 09:47:08 -0200, <codeur_at_[hidden]> wrote:

> Hello,
>
> I know the question has already been asked
> (http://groups.google.com/group/boost-list/browse_thread/thread/9e1bcbd7c4f76cb8/7cfd47f06f01bf71?lnk=st&q=serialize+template+abstract+boost&rnum=1&hl=en#7cfd47f06f01bf71)
> but without answers. So I retry..
>
> Is it possible to serialize an object that inherits from a templated
> abstract class ?
>
> For instance :
>
> template<typename T>
> class base
> {
> };
>
> template<typename T>
> class Impl : public base<T>
> {
> };

You can hack your way to it by means similar to the ones I used here

http://groups.google.com/group/boost-list/browse_thread/thread/2c91d43bb78ea2a1/a4a60b2e79af6c92

However, your case is slightly different. In your case it shouldn't
matter if Impl<A> and Impl<B> are given the same name, because there's not
chance of mixing the two due to C++ typing rules. I don't know if this
works in the serialization library as it is, though.

Bruno


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