Boost logo

Boost :

Subject: [boost] Documenting and checking template parameters
From: Paul A. Bristow (pbristow_at_[hidden])
Date: 2013-05-26 05:14:13

I am just refactoring the venerable circular_buffer documentation.
The docs describe the Template parameter T and specify it thus:
The type of the elements stored in the circular_buffer. The T has to be SGIAssignable (SGI STL
defined combination of Assignable and CopyConstructible).
Moreover T has to be DefaultConstructible if supplied as a default parameter when invoking some of
the circular_buffer's methods e.g. insert(iterator pos, const value_type& item = value_type()).
And EqualityComparable and/or LessThanComparable if the circular_buffer will be compared with
another container.
This looks a bit out of date?
How should a parameter like this *best* be described in documentation and enforced in software? ? ?
Should these concepts be checked using BOOST_STATIC_ASSERT?
Should *All* these be checked, even though not required for all uses?
Suggestions welcome.

Paul A. Bristow,
Prizet Farmhouse, Kendal LA8 8AB  UK
+44 1539 561830  07714330204

Boost list run by bdawes at, gregod at, cpdaniel at, john at