Boost logo

Boost :

From: Eric Friedman (ebf_at_[hidden])
Date: 2003-02-19 20:40:43


Peter Dimov wrote:
> Eric Friedman wrote:
> > Peter Dimov wrote:
> [...]
> >> template <class T, ...> T & extract(variant<...> & operand);
> >> template <class T, ...> T const & extract(variant<...> const &
> >> operand); template <class T, ...> T * extract(variant<...> *
> >> operand);
> >> template <class T, ...> T const * extract(variant<...> const *
> >> operand);
> >>
> >> it's no longer ambiguous.
> >
> > I believe it is. The following (admittedly silly) example fails to
> > compile under Comeau:
> >
> > // -- BEGIN CODE EXAMPLE --
> > template <class T, class Extractable> T & extract(Extractable &
> > operand); template <class T, class Extractable> T const &
> > extract(Extractable const & operand);
> >
> > template <class T, class Extractable> T * extract(Extractable *
> > operand); template <class T, class Extractable> T const *
> > extract(Extractable const * operand);
>
> This is not what I wrote above.

OK, I believe I see what you're saying.

Problem is that I was trying to design a general boost::extract<> facility,
one that needs not be specialized for each type. (Indeed, with my design,
visitable types need not be cognizant of the facility at all.)

Is this impossible? Or am I in fact misunderstanding what you're trying to
say?

Thanks,
Eric


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