Boost logo

Boost :

From: Michael Goldshteyn (mgoldshteyn_at_[hidden])
Date: 2005-11-18 09:00:49

"Bruno Martínez" <br1_at_[hidden]> wrote in message
>On Thu, 17 Nov 2005 12:32:59 -0200, Michael Goldshteyn
><mgoldshteyn_at_[hidden]> 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.


Michael Goldshteyn

P.S. I am still interested in other alternative approaches to this, if
anybody can come up with one.

Boost list run by bdawes at, gregod at, cpdaniel at, john at