Boost logo

Boost :

Subject: Re: [boost] Boost library submission (poll for interest)(2)
From: Rutger ter Borg (rutger_at_[hidden])
Date: 2010-01-19 02:47:19


strasser_at_[hidden] wrote:

> if you keep using serialization we should also think about unifying
> this aspect of our libraries. as we've discussed before I have some
> ADL functions that avoid boost.serialization if possible.
>
> they
> 1. use std::memcpy() if serialization::is_bitwise_serializable<> yields
> true 2. use user-supplied functions, described here:
>
> 3. only if 1 and 2 fails, invokes Boost.Serialization.
>

Interesting, when building an abstraction on top of Berkeley DB, here I used

1) type_traits/has_trivial_copy
2) introduced a has_trivial_array type trait (type that serializes with
ptr/size, and can be constructed with a ptr/size), e.g., std::vector,
std::string, etc.
3) serialization fallback

1) and 2) may also be easily used with Asio's buffer concept.

Cheers,

Rutger


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