• Advertisement

Archived

This topic is now archived and is closed to further replies.

How do I typedef a template?

This topic is 6215 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I use std::vector quite a lot but I use it in ways that it shouldn''t support (like memcopying between beginning and end). One day if this gives me problems I''ll write my own array class however I don''t want to have to rewrite large portions of my code so I''d like to typedef std::vector to CArray. That way if I ever need to drop vectors I can just replace the typedef with an implementation. typedef std::vector CArray doesn''t work however... Is this a syntax thing? thanks chris

Share this post


Link to post
Share on other sites
Advertisement
i think if you make CArray inherit from Vector,you can use CArray or CArray as your wish, and you can change to another container implemetation by modify the CArray''s definition, it wouldn''t take lots of time.

------------------------------
Dedicate to nobody, I''m nobody

Share this post


Link to post
Share on other sites
oh god rides the flaw, the board changed my post:

  CArray<int> or CArray<YourClass>  


------------------------------
Dedicate to nobody, I''m nobody

Share this post


Link to post
Share on other sites

  • Advertisement