Boost logo

Boost :

From: Paul Mensonides (pmenso57_at_[hidden])
Date: 2003-01-11 15:32:16


----- Original Message -----
From: "Paul Mensonides" <pmenso57_at_[hidden]>

> 14.3.1/2 [quote--
>
> A local type, a type with no linkage, an unnamed type or a type compounded
> from any of these types shall not be used as a template-argument for a
> template type-parameter.
>
> --end quote]

Incidently, an unnamed type has no linkage. Secondly, even if it is named,
it has internal linkage if it is member of a class with internal linkage:

namespace {

template<class T> struct X {
    enum value_t { value = 10 };
};

}

template<class T> void f(const T& ref) {
    // ...
    return;
}

int main() {
    f( X<int>::value ); // error: X::value_t has internal linkage
    return 0;
}

Paul Mensonides


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk