Archived

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

Jx

std::vectors and abstract interfaces

Recommended Posts

Jx    122
Ok, so I have an IRenderable interface. I want to make a vector of theses IRenderables. Now before we go off on one saying "hey - you can't instantiate an interface!!" i know that. But what i want to do is this: derive loads of "effects" from IRenderable and then put them into a vector, then loop through the vector and draw the effects stored within. so i need to store the interface in the vector if you see what i mean... and if i do this: std::vector< *IRenderable > RenderList; i get an error... any ideas? cheers Jx Edited by - Jx on February 8, 2002 9:09:13 AM

Share this post


Link to post
Share on other sites
SteveC    122
I think if you make it

  
std::vector<IRenderable*> RenderList;


and make sure you have a forward declaration to the IRenderable type

Share this post


Link to post
Share on other sites