Boost logo

Boost :

Subject: [boost] Generalized concept usage in Boost libraries
From: Mathias Gaunard (mathias.gaunard_at_[hidden])
Date: 2009-07-26 12:32:35


With Concepts removed from C++Ox, people have been disappointed that
this chance of making C++ template code generate better error messages
was given up.

Yet, there is no need for C++0x concepts in order to achieve this.
Indeed, we have Boost.ConceptCheck that already makes things a bit simpler.
Plus, by extending it with SFINAE for expressions, which allows to
detect whether a type models a concept at compile-time, we get almost
the same quality in error messages as with C++0x concepts.

It would even allow to do concept-based overloading, but since SFINAE
for expressions is not an universally supported feature, code shouldn't
rely on that.

Should all Boost libraries be modified in order to include concept
checking, and should it become part of the programming policy?
 From what I can see, it seems most libraries don't make use of
Boost.ConceptCheck at all.


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