Boost logo

Boost :

From: Daniel Frey (daniel.frey_at_[hidden])
Date: 2003-01-30 12:43:19


Gennaro Prota wrote:
>
> to avoid changes not forced by compiler bugs. Incidentally, I noticed
> that if you add a default argument
>
> template<typename T>
> static yes check(D const volatile *, T = 0);
> static no check(B const volatile *, int = 0);
>
> and write:
>
> sizeof(checker<B,D>::check( (C()) /*, 0*/ ))
>
> then ambiguity problems arise, even with Comeau 4.3.0.1. Defect in the
> standard?

What should the compiler deduce for T? Argument type deduction doesn't
work well with default parameters. There is already a DR (IIRC) that
would allow:

template<typename T = int>
static yes check(D const volatile *, T = 0);

but I don't know if any compilers implement it yet.

Regards, Daniel

-- 
Daniel Frey
aixigo AG - financial training, research and technology
Schloß-Rahe-Straße 15, 52072 Aachen, Germany
fon: +49 (0)241 936737-42, fax: +49 (0)241 936737-99
eMail: daniel.frey_at_[hidden], web: http://www.aixigo.de

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