-
Notifications
You must be signed in to change notification settings - Fork 195
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Documentation Enhancement: Header to Include to get Class/Function #152
Comments
Qt has done pretty interesting thing, and created a bunch of very simple include files for most of their classes, for example a class named 'QString' has a #include "qstring.h" as it's only content, so users know that they can |
That might be interesting as a way of unifying includes, but I seem to remember @BearishSun not wanting to separate out includes/source anymore because of how much of a pain it was to maintain two trees. I feel like this would fall under the same problem. Either way, the docs should list it. |
I think most I'm pretty sure Doxygen has an option to enable this but I'm not sure what it is at the moment. I'll take a closer look when I get more time. |
Can I try this ? |
You will want to look at this issue first #418 |
To use a class or function in C++, you need to include the corresponding header file that contains the class/function declaration. The header file typically has the same name as the class or function with the extension ".h" or ".hpp". For example, to use the string class and its member functions in C++, you would include the header file in your source code like this: #include <string>
int main() {
std::string str = "Hello, world!";
// Use string member functions here
return 0;
} Similarly, if you have defined your own class or function in a separate header file, you would include that file in your source code using the #include directive. For example, if you have a file called "myclass.hpp" that defines a MyClass class, you would include it like this: #include "myclass.hpp"
int main() {
MyClass my_obj;
// Use MyClass member functions here
return 0;
} |
It would be very beneficial if the documentation would have something to tell you what to include in order to use that thing. CLion/Visual Studio should be able to find the symbol, but it would be a boon to anyone who is using a less advanced IDE.
The text was updated successfully, but these errors were encountered: