开发者

Policies Array Class-Design wrapper

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&g开发者_如何学JAVAt; 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?


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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜