File : A.cpp
void A::increment()
{
i++;
}
int A::get_i()
{
return i;
}
File : A.hpp
#ifndef HEAD_H
#define HEAD_H
class A
{
private:
int i;
public:
void increment();
int get_i();
};
#endif
I have a java background and I am moving to C++ from it. I am stuck to the idea of keeping one class per file to have a clean code. However I don like the idea of using the scope resolution operator which makes it look ugly taking away the class definition from the class.
Is there any way I can have keep the class definition within the class
construct ?
NOTE: I already visited this and this which does not answer my question.