namespace MySpace
{
class MyClass
{
public:
static void MyMethod(something.. )
{
//Logic
}
};
}
MySpace::MyClass::MyMethod(params.. );
namespace MySpace
{
class MyClass
{
public:
static void MyMethod(something.. )
{
//Logic
}
};
}
MySpace::MyClass::MyMethod(params.. );
test.h// Definition:#ifndef TEST_H#define TEST_Hclass Test{public: int Function();};#endiftest.cpp// Implementation:#include "test.h"int Test::Function(){ return 5;}otherfile.cpp// Usage:#include "test.h"int main(){ Test a; a.Function();}Quote:
Original post by Agwan
OK,
Is there any method of grouping the class contents if the class is defined in the header?
If not for any other reason than being able to collapse the code block in Visual Studio.
namespace MySpace{ definetypething class MyClass { public: static void MyMethod(something.. ); };}namespace MySpace{ definetypething class MyClass { public: static void MyMethod(something.. ); { //Logic and actual stuff } };}// Source file: myclass.cpp#include "myclass.h"namespace MySpace{ void MyClass::MyMethod(something.. ) { //Logic and actual stuff }}This topic has been locked by a moderator. New replies are not allowed.
With your permission, GameDev.net uses analytics cookies to understand how people use the platform. You can accept analytics or continue with necessary cookies only. Learn more