Boost logo

Boost :

Subject: Re: [boost] [C++0x] Report from Frankfurt committee meeting
From: Mathias Gaunard (mathias.gaunard_at_[hidden])
Date: 2009-08-12 16:04:10


Andrew Sutton wrote:

I'm also replying to Dave Abrahams here.

>> a. I doubt we could do as well with error messages
>
>
> You can't, but static_assert helps a bit.

What exactly can't be done?
Let's consider function templates.
Using concepts, the overload is masked if the concept is not fulfilled.
Using SFINAE, the overload is masked if the expressions lead to errors.

In both cases, the compiler just says there is no match, and eventually
gives a list of possible matches.

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

Similarly to a C++-Lint-like tool, it would only be run for debugging
purposes.

>> c. It wouldn't have the right syntax

Well, personally, I think defining concepts in terms of expressions is
better than doing so in terms of signatures.
But is the syntax really important?

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

The goal is not to be the same as the former C++0x concepts, but to
provide an effective compile-time debugging and type checking mechanism
with nice error messages.


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