Hello,
Let's make a class in *.h file:
#pragma once
namespace NA
{
namespace NB
{
class CTestClass
{
public:
struct STestStruct
{
size_t A;
bool b;
};
public:
CTestClass( void );
~CTestClass( void );
STestStruct Get();
};
};
};
Below I describe 2 problems with 'Create implementation' function:
Problem 1:
According to previous *.h file I have *.cpp file with code:
#include "StdAfx.h"
#include "TestClass.h"
namespace NA
{
namespace NB
{};
};
After using " create implementation" on constructor I got:
#include "StdAfx.h"
#include "TestClass.h"
namespace NA
{
namespace NB
CTestClass::CTestClass( void )
{
}
{};
};
Implementation is not in brackets so code will not compile
Problem 2:
I have the same header as previous and my implementation in *.cpp looks:
#include "StdAfx.h"
#include "TestClass.h"
namespace NA
{
namespace NB
{
CTestClass::CTestClass( void )
{}
};
};
After "create implementation" on "STestStruct Get();" member I got:
#include "StdAfx.h"
#include "TestClass.h"
namespace NA
{
namespace NB
{
CTestClass::CTestClass( void )
{}
STestStruct CTestClass::Get()
{
}
};
};
The CTestClass is ommited in Get() function definition.
STestStruct CTestClass::Get() should be: CTestClass::STestStruct CTestClass::Get()
Regards, Mariusz.