This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [libstdc++] New implementation of concept checking
- To: Toon Moene <toon at moene dot indiv dot nluug dot nl>
- Subject: Re: [libstdc++] New implementation of concept checking
- From: Gabriel Dos Reis <Gabriel dot Dos-Reis at cmla dot ens-cachan dot fr>
- Date: 03 Apr 2001 23:58:35 +0200
- Cc: Phil Edwards <pedwards at disaster dot jaj dot com>, gcc-patches at gcc dot gnu dot org
- Organization: CMLA, ENS Cachan -- CNRS UMR 8536 (France)
- References: <20010402204514.A30501@disaster.jaj.com> <3ACA35CD.73F2F44B@moene.indiv.nluug.nl>
Toon Moene <toon@moene.indiv.nluug.nl> writes:
| Phil Edwards wrote:
|
| > [To those of you in the studio audience who are wondering "what the
| > heck is Boost and what makes their code any good?" I can only say
|
| Surprisingly, that's _not_ the question that came to my mind. Rather:
| What's concept checking ? [ I guess it's something that comes before
| implementation checking .... ]
The whole story goes back to how to make diagnostics messages
involving templates /understandable/. Or how to ensure that a
template-argument has the required semantics for a successful class or
function template instantiation. Try this
#include <vector>
int main()
{
std::vector<int> v(9.0, 3.14);
}
to see what I mean.
The idea of concept checking is to express those constraints in form of
expressions/declarations which, given their spellings, should give
hints about the constraints assumed on the behalf of the template
arguments in case, some violations are detected. Those expressions
are expected not to incure runtime overhead, in theory.
That feature already exists in Standard ML in form of signatures. C++
just forgot to include them :-)
-- Gaby