Boost logo

Boost :

From: Peder Holt (peder.holt_at_[hidden])
Date: 2004-12-10 09:56:40


On Fri, 10 Dec 2004 14:54:26 +0200, Peter Dimov <pdimov_at_[hidden]> wrote:
> Peder Holt wrote:
>
>
> > On Fri, 10 Dec 2004 03:50:58 -0700, Larry Evans
> > <cppljevans_at_[hidden]> wrote:
> >> On 12/10/2004 03:25 AM, Larry Evans wrote:
> >>>
> >>> where the problem with typedef's is mentioned as the show-stopper.
> >>
> >> Actually, Rani Sharoni's post in that thread is the best explanation
> >> I've seen to date.
> >>
> >
> > Still, the problem in his post applies to typedefs.
> > If A<T>::B is a nested class or struct under A<T>, and not a typedef,
> > deduction should always be possible.
> >
> > In the case where B is a typedef:
> > typedef typename some_class<T> B;
> > you can deduce some_class<T> instead of A<T>::B
>
> No, you can't. Given some_class<V> as input to the pattern A<T>::B, you have
> no way to deduce T.
>
> template<class T> struct A
> {
> typedef typename arbitrarily_complex_metafunction<T>::type B;
> };
>
> And of course getting back to iterators, you have no way of determining
> whether T* is T*, vector<T, A>::iterator, or basic_string<T, Tr,
> A>::iterator, much less deducing A or Tr.
>

What I was trying to say, was that, given that there are no nested
classes involved,
arbitrarily_complex_metafunction<T>::type will in the end be reduced
to arbitrary_complex_type<A0,A1,A2,...>, which is a concrete type
which can be deduced. For the typeof library this is sufficient.

On the other hand:
template<class T> struct A
{
  class B;
};
A<T>::B now should give sufficient information to be deduced.

> _______________________________________________
>
>
> Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
>


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