Boost logo

Boost :

From: Reece Dunn (msclrhd_at_[hidden])
Date: 2004-09-21 05:39:14


John Torjo wrote:
>>>My real observation is that I see this as orthogonal to serialization and
>>>that it should remain that way. I don't seen any real overlap now except
>>>that there might be a couple of instances where either one might do. I
>>>think even these would be rare cases. I would resist any idea to
>>>intertwine these concepts.
>>
>>I'm lost. What are "these concepts"? What I propose is that the
>>"serialize"
>>method be usable by the outfmt library to generate more usable output. No
>>other link between the two libraries is suggested.
>>
>I assume you suggest something like:
>- if an object can be serialized, use that for output

Is there a way to test if a class can be serialized. If that is the case,
maybe it would be beneficial to add it into fmt::basic using MPL wizardry.
I.e. can you do:
   mpl::if_< is_serializable< T >, ..., ... >
?

>- if not, use default (operator<<)
>
>This seems ok to me. Reece?

I was thinking of having a separate format object (fmt::serialize?) instead
of complicating fmt::basic. You can then do:
   BOOST_IO_CLASSIFY( SerializableType, boost::io::serializable_type )
to add it into the type deduction mechanism, unless there is an
is_serializable< T > trait.

Alternatively, you would be able to explicitly designate to use 'serialize':

   io::object( people, fmt::container( fmt::serialize()));

Regards,
Reece

_________________________________________________________________
Stay in touch with absent friends - get MSN Messenger
http://www.msn.co.uk/messenger


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