Boost logo

Boost :

Subject: Re: [boost] Making two Boost libraries interoperate
From: Joaquin M López Muñoz (joaquinlopezmunoz_at_[hidden])
Date: 2019-04-24 15:56:08


El 24/04/2019 a las 14:39, Andrzej Krzemienski via Boost escribió:
> Hi Everyone,
> Somewhat in connection with the discussion about modularizing Boost
> libraries, we had a certain conceptual problem recently about providing a
> customization code that allows Boost.Serialization library to serialize
> Boost.Optional. Such customization requires some code to be written
> (template specializations provided).
>
> [...]
>
> However, it is a natural expectation of a Boost user that if the library
> offers two components they should just smoothly inter-operate with one
> another. We could provide a small module Serialization-Optional-interop,
> but that would require many such components to exist and be maintained by
> someone.
>
> I would like to obtain some guidance on how to address such issue. The same
> problem must already be present between other Boost libraries. Maybe this
> has been already brought up, and we have a policy for solving this problem
> somewhere?

Not sure if this helps, but the way I did it in Boost.Flyweight is by
isolating all serialization code
in a separate header:

https://www.boost.org/libs/flyweight/doc/reference/flyweight.html#serialize_synopsis

So, if I want to serialize boost::flyweight's, I need to include
<boost/flyweight/serialize.hpp>
and link with Boost.Serialization. This, I think, makes Boost.Flyweight
technically not dependent
on Boost.Serialization.

Joaquín M López Muñoz


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk