I would like to write code in .hpp without separation to .h and .cpp
- I did it. I use .cpp only for static class-fields definitions
I would like not to write #include manually ...
- I use forward delarations where it possible.
- Every my .hpp file containt #pragma once.
- But, when my project grows up to 40-50 classes i saw problem of include graph. There are some errors of definitions.
Image with include graph of my project model (like part of mvc) attached.
I used this app for graph generation (can work without MSVS!).
How include graph should look like? Like a tree?
How not to write includes manually, like in C# or Java?
Unfortunately you're possibly using the wrong language. There are some things that are just much in C++ easier when you separate the class definition from implementation. Even with forward declarations you'll probably still wind up with circular dependencies that can only be resolved by moving implementations into separate files.
If you want to write idiomatic Java, just write it in Java. If you want to use the C++ language unfortunately you'll have to work within its constraints.