From: David Abrahams (dave_at_[hidden])
Date: 2006-04-11 00:27:35
"Robert Ramey" <ramey_at_[hidden]> writes:
> On the other hand - I don't see the motivation for including concepts
> in the core language. Haven't we been able to implement concept
> checking with the current facilities of the library?
Concepts in the language go way beond checking. There's a great deal
of mess that we deal with today because we don't have true concept
support: everything from the perils of ADL, to the need for the
"typename" and "template" keywords, to tag dispatching, which is
really just a hack we invented to simulate concept-based overloading,
to many uses of enable_if, will largely disappear from code written
with in-language concept support.
> It seems to me that the main problem these days with the C++
> language these days is that its too hard to write a correct compiler
> for it. Making the core language fancier will only make this
> problem worse.
Actually, implementing concept support presents no great difficulty,
as Doug has demonstrated by implementing ConceptGCC.
> While, the commitee is at it - how about re-visiting two-phase lookup.
> Apparently there are enough implementers skeptical about it that
> they've declined to implement it.
AFAICT you just mean that Microsoft hasn't implemented it yet. All
the other major compiler vendors who actually do work on their C++
front ends at a reasonable pace (I'm not counting Borland in that
group) have got two-phase lookup implemented.
> (for good reason in my opinion). I believe this is related to the
> "export" feature - which has also failed to gain traction.
No, it's not related to export; it was implemented so that outright
errors in templates could be detected immediately where the template
was defined, rather than later when it is instantiated. Two-phase
lookup makes sense even for non-exported templates. An expression in
a template that doesn't depend on the template parameters shouldn't
change its meaning arbitrarily based on code that happens to come
*after* the template definition.
If you don't like that idea, you're probably not going to like
in-language concept support, since it is capable of moving *all* the
checking to phase 1. That's a major benefit.
> So its seems to me that there are a number of issues more
> important/urgent than the ones currently being focused on.
I'm afraid it's the same old song: if you want the committee to focus
on other issues, write a proposal that gets those issues on the table.
-- Dave Abrahams Boost Consulting www.boost-consulting.com
Boost list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk