From: David Abrahams (dave_at_[hidden])
Date: 2005-11-18 19:05:11
Bruno Martínez <br1_at_[hidden]> writes:
> On Thu, 17 Nov 2005 12:32:59 -0200, Michael Goldshteyn
> <mgoldshteyn_at_[hidden]> wrote:
>> "Bruno Martínez" <br1_at_[hidden]> wrote in message
>>> 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
>>> if mentioning it as a parameter is a 'use'.
>>> Maybe this thread should be moved to c.l.c++.moderated.
>> 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.
It's not a question of "fully using." If the vector type is
instantiated before the parameter is fully defined, it's an error.
Otherwise, you're OK. The forward declaration technique can be used
legally in many scenarios.
-- Dave Abrahams Boost Consulting www.boost-consulting.com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk