[ConceptGCC] |
ConceptGCC :Associated class templates |
From: Marcin Zalewski (zalewski_at_[hidden])
Date: 2007-05-01 16:46:07
Hello,
The "Proposed wording for concepts"
(http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2193.pdf)
gives an example (page 22):
concept Allocator<typename Alloc>
{
template<class T>
struct rebind;
};
Yet, conceptGCC gives an error for such concept:
template<class Alloc> template<class T> struct Allocator<Alloc>::rebind
is not permitted in a concept
I am wondering what is the current thinking about associated class
templates. That aspect of concepts seems to be covered very scarcely in
the concept proposal even though it is allowed by the grammar
specification. Is it underspecified because concepts designers are not
sure how to handle associated class templates? And a related question,
will associated class templates be included in concept proposals in the
future or is it a feature that may likely get dropped?
The question is related to my previous post about a Monad concept. If
associated class templates would be allowed then concepts could provide
type computations. As for now type computations (such as rebind) seem to
be impossible without associated class templates.
-m