Boost logo

Boost Users :

Subject: Re: [Boost-users] [serialization] compile-time detection of whetherserialization is implemented for a class
From: Robert Ramey (ramey_at_[hidden])
Date: 2012-02-16 12:51:02


Nelson, Erik - 2 wrote:

> What I'd like is a compile-time way of detecting that 'A' is not
> serializable, maybe Boost Type Traits-style, something like
>
> is_serializable<A>::value or is_serializable<binary_oarchive,
> A>::value that can detect whether or not the object has serialization
> available.
>
> If it could work for testing pointer serialization as well
> (is_serializable<A*>::value or is_ptr_serializable<A>::value) that
> would be doubly super.
>
>

I'm sure this would be possible and probably not all that hard
but would likely require a tweak in the serialization library.
Add a trac item so the idea doesn't get forgotten.

Robert Ramey


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