Boost logo

Boost :

From: Gabriel Dos Reis (gdr_at_[hidden])
Date: 2003-01-11 12:44:42


"Paul Mensonides" <pmenso57_at_[hidden]> writes:

[...]

| However, this
| raises another interesting problem. Many enumerations used for this purpose
| are unnamed:
|
| template<class T> struct is_ptr {
| enum { value = false };
| };
|
| template<class T> struct is_ptr<T*> {
| enum { value = true };
| };
|
| This has its own problem in the same templated "pass by reference"
| situation. Namely, a template type argument cannot refer to an unnamed
| type:
|
| template<class T> T func(const T& ref) {
| return ref;
| }
|
| int main() {
| func( is_ptr<int*>::value );
| // error: argument deduction yields unnamed type

Probably I'm being dense here, but please could you work out *why* you
think the above should fail?

-- Gaby


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