
"Bruno MartÃnez" <br1@internet.com.uy> wrote in message news:op.s0exlge3551aze@yoda...
On Thu, 17 Nov 2005 12:32:59 -0200, Michael Goldshteyn <mgoldshteyn@comcast.net> wrote:
You cannot forward declare a type used as a value for vector.
Yes, I know. However, not fully using such instantiation, as is the case, seems somewhat less wrong.
Another way to solve the problem is using an auxiliar class, vectorAction, which is forward declared at the beginning. It's definition,
class vectorAction { vectorAction(std::vector<Action>& ref) : value(ref) {} std::vector<Action>& value; };
is put as the last thing. All uses of vector<Action>& are then changed for vectorAction. Does this work?
Now we're "cooking with gas." This may be the trick I need to get around it. By wrapping a vector of actions in another class, I can just forward declare that class and not have dependencies on actions or vectors of actions. Thanks, Michael Goldshteyn P.S. I am still interested in other alternative approaches to this, if anybody can come up with one.