Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2006-05-21 15:33:05


Hi Robert,

Once again I find myself confounded by the true concept requirements
for archives. Once upon a time, the truth-as-we-knew-it was that the
following (copied from the library docs) was part of the input archive
requirements.

  All input archives should be derived from the following template:

  template<class Archive>
  detail::common_iarchive;

But, as I just discovered: polymorphic_iarchive doesn't meet those
requirements.

Since you have struggled with how to write the concept requirements
for archives, I have a brilliant suggestion: create concept checking
classes and archetypes using Boost.ConceptCheck, and use those to
formulate and validate your concepts. Then you can simply copy the
concept checking classes into your documentation and add a description
of semantic constraints. You can't go wrong if you do that; the
compiler will check your work for you, and make sure your code is
consistent with your documentation.

[I have recently upgraded the ConceptCheck library to allow some nicer
but as-yet-undocumented syntax. When (if?) you decide to do this,
I'll give you the quick skinny]

-- 
Dave Abrahams
Boost Consulting
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