I usually recommend not using (only) an IDE or language syntax to organize your source code. First, you become attached to the environment: well organized in the IDE, unorganized in the file, and then the day comes when you may want to use another environment ...
Because of this, I usually use all three methods of organizing my source at the same time: I divide my source into functional modules, that is, related classes. Each module gets its own namespace, physical folder, and IDE folder. (In my case, if necessary, use CMake and source_group() to generate the IDE project files - personally preferring the command line, Vim, and "make".)
Therefore, whether I am looking at a project from the IDE, from the command line, or from the compiler log, foo / some_class.hpp is foo / some_class.cpp is foo :: some_class, minimizing confusion.
In fact, my currently preferred installation further subdivides each module directory into <project>/<module>/<class>.hpp or <project>/<module>/src/<class>.hpp depending on which whether the class is outside its own module or not, <project>/<module>/src/<class>.cpp and <project>/<module>/test/<class>_tu.cpp . The namespace, of course, is <project>::<module>::<class> .
project |-- foo | |-- some_class.hpp | |-- src | | |-- internal_class.hpp | | |-- internal_class.cpp | | '-- some_class.cpp | '-- test | |-- internal_class_tu.cpp | '-- some_class_tu.cpp |-- bar | |-- ...
The idea is that the "external" interface of each module ( foo ) is documented by the headers in this subfolder, and implementation details and tests are "hidden" in the corresponding subfolders.
But in the end, it very much depends on your taste, the taste of your co-developers and the scale of your project.