Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2003-01-13 09:43:04


From: "David Abrahams" <dave_at_[hidden]>
> "Paul Mensonides" <pmenso57_at_[hidden]> writes:
>
> >> template <class T> struct voidify { typedef void type; };
> >> template <class T> struct Y {};
> >> struct X
> >> {
> >> template <class T>
> >> operator Y<T> (typename voidify<T>::type) const { return Y<T>(); }
> >> };
> >
> > Is this even legal? I.e. for a user-defined conversion operator to have
any
> > arguments at all?
>
> Look twice; the argument is void.

Doesn't matter. f(T) has one argument for any T. f(void) (void is a keyword
here, not a type expression) has zero arguments.


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