2

I have an abstract class defined as follows:

class AnimatedDraw
{
public:
    virtual void Draw(sf::RenderWindow &window) = 0;
    virtual void Draw(sf::RenderWindow &window, sf::Shader shader) = 0;
    virtual void Update(sf::Clock &time) = 0;
};

I'm trying to inherit from it into another class defined as follows:

class ScreenLayer explicit : public AnimatedDraw
{
public:
    ScreenLayer(void);
    virtual void Draw(sf::RenderWindow &window) override; //I'll need to be able to override these again in subclasses
    virtual void Draw(sf::RenderWindow &window, sf::Shader &shader) override;
    virtual void Update(sf::Clock &clock) override;
    ~ScreenLayer(void);
};

The source file is empty functions right now and is as follows:

#include "ScreenLayer.h"
ScreenLayer::ScreenLayer(void)
{
}
void ScreenLayer::Draw(sf::RenderWindow &window)
{
}
void ScreenLayer::Draw(sf::RenderWindow &window, sf::Shader &shader)
{
}
void ScreenLayer::Update(sf::Clock &clock)
{
}
ScreenLayer::~ScreenLayer(void)
{
}

I'm doing something wrong, as my compiler (VC2010) produces several errors, including complaining it can't find ScreenLayer in the ScreenLayer.cpp file, and several about this line class ScreenLayer explicit : public AnimatedDraw I haven't tried to use explicit overrides before, but according to the C++0x article on wikipedia, that is how you do it. Does VC2010 not support explicit overrides, or did i mess something else up?

Thanks in advance

Björn Pollex
  • 75,346
  • 28
  • 201
  • 283
Megatron
  • 2,871
  • 4
  • 40
  • 58
  • I was under the impression that this use of explicit and override was not accepted into C++0x in favor of attributes. Are you sure that this will be legal under the new standard? – templatetypedef Mar 24 '11 at 07:08

1 Answers1

2

Apparently it doesn't support explicit. It's fine because it probably won't go to the standard.

Yakov Galka
  • 70,775
  • 16
  • 139
  • 220