forward declaration and enums

Discussion in 'C++' started by Barry, Mar 22, 2010.

  1. Barry

    Barry Guest

    I have the following class which won't compile in VS2008.

    #include "Image.h"

    class b : public std::map<const b_e, const Image>
    {
    public:

    enum b_e {ONE,TWO};
    };

    How would you fix this problem? The only solution I have come up with
    is this -

    #include "Image.h"

    class b
    {
    public:

    enum b_e {ONE,TWO};
    std::map<const b_e, const Image> i;
    };

    but is there a better way of doing it?

    Thanks,

    Barry.
     
    Barry, Mar 22, 2010
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. qazmlp
    Replies:
    1
    Views:
    604
    Jonathan Turkanis
    Feb 15, 2004
  2. =?utf-8?b?QXNiasO4cm4gU8OmYsO4?=

    Enums without identifier, enums and typedef

    =?utf-8?b?QXNiasO4cm4gU8OmYsO4?=, Jan 19, 2007, in forum: C Programming
    Replies:
    10
    Views:
    1,136
    Keith Thompson
    Jan 20, 2007
  3. Steven T. Hatton
    Replies:
    2
    Views:
    448
    Steven T. Hatton
    Nov 20, 2006
  4. Travis
    Replies:
    1
    Views:
    303
  5. Francesco S. Carta

    Re: Forward declaration of enums

    Francesco S. Carta, Jul 15, 2010, in forum: C++
    Replies:
    13
    Views:
    678
    Öö Tiib
    Jul 18, 2010
Loading...

Share This Page