namespaces and forward declarations

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • matthew polder

    namespaces and forward declarations


    Hi,

    I have two libraries that used different namespaces, call them "fruit" and
    "vegetable. " In one of the class definitions of fruit, I have the following.

    class corn; //This doesn't work.

    namespace fruit
    {
    class Apple
    {
    Apple( const vegetable::corn & )
    {}
    };

    }

    How do I do a forward declaration for something in a namespace?

    thanks,
    matthew


  • John Harrison

    #2
    Re: namespaces and forward declarations


    "matthew polder" <matthew.polder @kodak.com> wrote in message
    news:bfovtv$flh $1@news.kodak.c om...[color=blue]
    >
    > Hi,
    >
    > I have two libraries that used different namespaces, call them "fruit" and
    > "vegetable. " In one of the class definitions of fruit, I have the[/color]
    following.[color=blue]
    >
    > class corn; //This doesn't work.
    >
    > namespace fruit
    > {
    > class Apple
    > {
    > Apple( const vegetable::corn & )
    > {}
    > };
    >
    > }
    >
    > How do I do a forward declaration for something in a namespace?
    >
    > thanks,
    > matthew
    >[/color]

    Have you tried?

    namespace vegetable
    {
    class corn;
    }

    john


    Comment

    Working...