a class declaration is where you declare the class hence. or as
From the C++ standard section 3.1:
A declaration introduces names into a translation unit or redeclares
names introduced by previous declarations. A declaration specifies the
interpretation and attributes of these names.
In essence the declaration tells the compiler a certain object, variable, etc with a certain name exists. There can be multiple declartions in a compile unit
so in a way
class X; // is declaration also known as forward declaration.
Is just a declaration.
However there must always be just one and only one definition for each object / variable.
And a definition is basically everything the compiler needs in order to create an instance of that class / object / struct / variable etc.
In c++ many times a class declaration can also be a definition or partial definition/
//declare a class and declare it's members.
class X { //declares X and starts to define it
void test (); //declare test method
int b; // declare b member
}
the full definition can then be in a .cpp file like this:
void X::test() {
//test code
}
or in the class declration like this:
class X {
void test () {
//test code
}
Here is an extensive stackoverflow discussion on the differences:
What is the difference between a definition and a declaration?
I believe the author is recommending that you do not use the second type of declaration in which you declare and define the methods inside the class definition but in a separate c++ file. This is because of the C++ define only once rule, you do not want to include the same .h file from multiple files and have multiple definitions for the same class.
Here is another extensive discussion on why you should seperate:
Is is a good practice to put the definition of C++ classes into the header file?