Indiana Unversity logo[ConceptGCC]

ConceptGCC :

Re: Concept C++: excessive where-clauses?

From: Karl Meerbergen (Karl.Meerbergen_at_[hidden])
Date: 2007-01-22 05:05:43


Hi,

I have had similar experience.

Karl

Dietmar Kuehl wrote:

>Hi,
>
>while working on a generic library (implementing the STL algorithms based
>on property maps and cursors, of course), I started to use conceptgcc and
>I came across a rather weird issue: concepts of internally used classes, i.e.
>actually implementation details, need to be declared in the where-clauses
>of checked templates. This is rather unexpected and causes, IMO, serious
>usability problems. Thus, I want to make sure that this is merely an artifact
>of the current implementation in GCC rather than the intended behavior.
>
>Below is an example which demonstrates the point. Although it is somewhat
>pointless by itself, the same issue arises when delegating e.g. from find()
>to find_if(), using a corresponding function object: All what is required for
>the function object to be instantiated is that the template arguments are
>equality comparable. This is precisely the requirement imposed on them.
>Thus, I would have expected that I can instantiate equal_to with the proper
>types without further ado which, however, results in an error: the function
>object can't be used with the function call operator until I explicitly add this
>to the requirements! Why is this necessary? IMO I have already declared
>everything which is necessary to call use this function object!
>
>Thank you very much for any insights,
> Dietmar
>
>

Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm