Boost logo

Boost :

Subject: Re: [boost] [C++0x] Report from Frankfurt committee meeting
From: Andrew Sutton (andrew.n.sutton_at_[hidden])
Date: 2009-08-12 15:45:03


>
> <aside>
> I bet for C++0x compilers that support SFINAE on expressions, we could
> build a much nicer Boost.ConceptCheck library. I'd be curious to see how far
> we could go.
> </aside>
>

You can go pretty far. I've been working on exactly this problem for the
past week or so.

I've basically taken the approach of treating requirements (i.e., of the
form Iterator<X>) as a facade for type traits-style queries and
Boost.ConceptCheck style-assertions (among other things).

But, to address Dave's concerns:

> a. I doubt we could do as well with error messages

You can't, but static_assert helps a bit.

> b. It would be slower (at compile time)

It seems to be faster than ConceptGCC, but I agree that a compiler could do
it better.

> c. It wouldn't have the right syntax

Well, no. You can get close to "approximating" the syntax, but a real
grammar would be better. Also, there are also some features that are
essentially impossible to implement outside the compiler. Partially ordering
overloads based on the most-refined model is one example.

> d. It wouldn't do the right thing
>

What's the right thing, in this case?

I have a couple of issues to work out, but I think I'll have a first draft
of the library ready in the next day or so. I'll try to post a link and
coherent introduction and overview then.

Andrew Sutton
andrew.n.sutton_at_[hidden]


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