0

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?

PT.
  • 65
  • 5

2 Answers2

1

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.

Community
  • 1
  • 1
Roman Nikitchenko
  • 12,800
  • 7
  • 74
  • 110
0

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.

lyricat
  • 1,988
  • 2
  • 12
  • 20