views:

67

answers:

2

Hi,

i want to write an wrapper for different Array Classes with different Policies.

For example:

typedef ArrayType<useValArray,StdAllocator> Array; // one global assignment

I want to use the class like a blitz++ Array

for example:

Array<double,2> x(2,2); //maps the Array to an Valarray or to a Blitz++ Array
Array<double,2> x2(5,6);

is this Posible? Which technics i need to realise that?

+1  A: 

I think not in way you describe (at least because of template parameters) but ...

Short time ago STL wrapper for existing array was discussed here. I suggest you should look array_proxy recommendation as starting point.

Roman Nikitchenko
A: 

I'm not sure I entirely understand your question, but I think you're asking about 'templated typedefs' which aren't directly supported in C++, but can be mimicked. Also note, templated typdefs are included in C++0x.

Evän Vrooksövich