Indiana Unversity logo[ConceptGCC]

ConceptGCC :

Incorrect example code in the n2193.pdf concept specification

From: Tom Honermann (tom.honermann_at_[hidden])
Date: 2007-06-07 20:08:34


Hi all,

I believe the example code in the concept specification section
7.6.3.1-3
(http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2193.pdf) is
incorrect:

    3 If the name f is declared in concept scope C, and f refers to one
    or more associated functions (7.6.1.1), then the result of name
    lookup is an overload set containing the associated functions in C
    in addition to the overload sets in each concept scope in CR for
    which name lookup of f results in an overload set. [ Example:

        concept C<typename T> {
            T f(T); // #1
        }
        concept D<typename T> {
            T f(T, T); // #2
        }
        template<typename T>
        requires D<T>
        void f(T x)
        {
            D<T>::f(x); // name lookup finds #1 and #2, overload
        resolution selects #1
        }

    --end example ]

In the example code, concept D should refine concept C. Ie, it should be:

    concept D<typename T>* : C<T>* {
        T f(T, T); // #2
    }

Tom.