Boost logo

Boost :

From: Hamish Mackenzie (boost_at_[hidden])
Date: 2002-02-18 13:04:17


On Mon, 2002-02-18 at 17:47, Peter Dimov wrote:
> From: "dietmar_kuehl" <dietmar_kuehl_at_[hidden]>
> > What does qualify as "most needed"? Clearly, some features would
> > probably be useful and current C++ cannot do emulate them. 'typeof',
> > when done correctly, probably falls into this category while typedef
> > templates probably do not (they can be emulated similarily to the
> > 'rebind' class).
>
> No, when done correctly, they can't. X::typename rebind<...>::other (1) is a
> nondeduced context, (2) cannot match a template template parameter.
>
> (1)
>
> template<class T> typedef smart_ptr<T, ...> shared_ptr;
>
> template<class T> void f(shared_ptr<T>);
>
> (2)
>
> template<template<class> class V> void f();
>
> f<std::vector>(); // error
>
> template<class T> typedef std::vector<T> vector;
>
> f<vector>(); // OK

(3) Similar to 1

template< typename PTR >
class my_class{};

template< typename T >
class my_class< shared_ptr< T > > {};


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