|
Boost : |
From: Bruno Martínez (br1_at_[hidden])
Date: 2005-11-17 20:40:18
On Thu, 17 Nov 2005 12:32:59 -0200, Michael Goldshteyn
<mgoldshteyn_at_[hidden]> wrote:
> "Bruno Martínez" <br1_at_[hidden]> wrote in message
> news:op.s0c8nu06551aze_at_yoda...
>> On Wed, 16 Nov 2005 16:56:00 -0200, Michael Goldshteyn
>> <mgoldshteyn_at_[hidden]> wrote:
>> I think you can forward declare Action ate the top and define it later.
>> You end up with vector<Action> in arguments. I know that using standard
>> classes with incomplete types is not guaranteed to work, but I'm not
>> sure
>> if mentioning it as a parameter is a 'use'.
>>
>> Maybe this thread should be moved to c.l.c++.moderated.
>>
>> Bruno
>
> 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?
Bruno
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk