Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2002-09-12 18:07:00


From: "Eric Woodruff" <Eric.Woodruff_at_[hidden]>

> Here are my two cents on the serialization library:
>
> I haven't looked through it that much, just this message thread actually,
> but I plan on looking through what it supports further. (I'm still
looking
> for the link to where I can download it and check it out)
>
> 1) I disagree with the use of the << operator. iostreams already have
> claimed this operator and they mean a very specific usage: they imply
> formating, which includes removal of whitespace etc. This is a very
> different function of writing something out in binary.

I think you might be missing the fact that some things may be serialzed as
text

> 2) void pointers are bad practice, and in one of the usages I saw below,
> completely unnecessary. C++ provides templates, so use them. The idea of
> translating a type to a byte array should always require a reinterpret
cast:
>
> template <typename Object>
> void write_binary (Object const* const object) {
> /// do stuff reinterpret_cast and const_cast if necessary get a char
> const* const
> }
>
> You should never just ignore type information, no matter what the
purpose.

That's just wrong for portable code, since reinterpret_cast<> has
unspecified behavior.
void* has particular well-defined meanings, and a rule to avoid it prevents
successful implementation of many valid and useful constructs.

> ----- Original Message -----
> From: Robert Ramey
> Newsgroups: gmane.comp.lib.boost.devel

<snip LONG quote of *multiple* messages>

Please try to limit the length of quoted text in your postings. That was
way over the limit.

-----------------------------------------------------------
           David Abrahams * Boost Consulting
dave_at_[hidden] * http://www.boost-consulting.com


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