Boost logo

Boost :

From: Leland Brown (lelandbrown_at_[hidden])
Date: 2006-06-20 04:23:01


--- Bronek Kozicki <brok_at_[hidden]> wrote:

> > [Leland Brown wrote:]
> >> BTW, this is where I'd really like to see
> >> templatized
> >> typedefs in C++, allowing us to define:
> >>
> >> template< int N, type T >
> >> typedef vector< N, T, false > fixed_vector;
> >>
> >> template< int N, type T >
> >> typedef vector< N, T, true >
> >> resizable_vector;
> >>
> >> Thus we'd have:
> >>
> >> fixed_vector<N,T>
> >> resizable_vector<N,T>
> >>
> >> while using the common vector template defined
> >> above.

> There is simple way to emulate this,
> unfortunatelly with different semantics that would
> make metaprograms much more
> difficult to write:
> template< int N, type T >
> struct resizable_vector : vector< N, T, true >
> {};
>
> The difficulty comes from the fact that:
> some_useful_template<vector<10, int, true> >
> and:
> some_useful_template<resizable_vector<10, int> >
>
> are two distinct types

True. And in addition, you don't inherit the
constructors of vector.

-- Leland

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com


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