I have been making files like this for awhile:
Does the order make sense? or should the namespace and the #includes be swapped and why.
#ifndef CLASSNAME_H // header guards
#define CLASSNAME_H
#include "a.h" // includes in alphabetical order
#include "b.h" // user specified includes first
#include "c.h"
#include <vector> // then library includes
namespace MyNamespace
{
class ClassName
{
};
}
#endif
Yes. That’s looks good.
Though I order my headers differently (but alphabetically is fine).
The only thing I would change is the include guard. I make the include my namspace as well as the class name. As several times I have classes with the same name (but in a different namespace) being used by the same code.