Re: Synopsis roadmap
Doug Gregor <[email protected]>
| Newsgroups | gmane.comp.documentation.synopsis |
|---|---|
| Message-ID | <[email protected]> |
Stefan Seefeld <stefan <at> fresco.org> writes:
> David Abrahams wrote:
> > I don't think any semantic analysis is needed. But maybe you're
> > calling some things semantic analysis that I am not?
>
> Well, to be able to disambiguate certain constructs, I have to be able
> to do symbol lookup, at least non-dependent names.
Concepts would allow you to do a bit more disambiguation in
templates, but you can probably get away with doing very little
actual new work. A concept is can be handled much like a class
template, a model like a class template specialization (partial
or full).
Depending on how far you plan to go with name lookup, concepts
could introduce some complexities there. In particular, names can
be found inside concepts listed in the where clause, e.g.,
template<typename X>
concept Iterator
{
typename reference;
reference operator*(const X&);
};
template<typename T> where { Iterator<T> }
reference dereference(const T& x)
{ return *x; }
That 'reference' result type is found as Iterator<T>::reference.
If you run into trouble, feel free to ask. We've implemented most
of the proposal in GCC, so we've dealt with some of the stick
issues already. Concepts are pretty lightweight
syntactically (mainly because they rely on existing syntactic
elements for nearly everything), so parsing them for
documentation purposes shouldn't be too hard.
Doug