I'm having a problem with forward declarations in a nested namespace. I put a forward declaration for a class or struct in a nested namespace and when I try to use it in the parent of that namespace I get an error. I don't know what to do.
This is what the code looks like:
#include "Data\Types.hpp"
namespace GameEngine
{
class Console
{
public:
class Renderer : public RenderComponent2D
{
public:
Renderer(Console*, const GameEngine::DataProcessing::FontData*);
//...
and in Data\Types.hpp:
namespace GameEngine
{
namespace DataProcessing
{
struct FontData;
//...
and the error MinGW gives me is :
'FontData' in namespace 'GameEngine::DataProcessing' does not name a type
I appreciate any help or suggestions with this problem.
const DataProcessing::FontData *. - Kerrek SB#include, even under Windows. As is, you produce undefined behaviour, and there might some (current or future) compiler which doesn't like it (because it doesn't special-case string constants in#includedirectives and thus interprets\Tas escape sequence). Not to mention that one day you might want to port your program to a different system which doesn't use backslashes as directory separators. - celtschk