drzoom
Ketchup Master
Switzerland
57 Posts |
Posted - Nov 07 2006 : 02:27:25 AM
|
Preface: (C++) I'm still working trough old code and solving a lot of #include problems...
Topic: A feature would be nice, to add the correct #include for a given class or type.
Your objections: - It's not easy to find the right #include file, because many libraries are using "proxy" includes forwarding to the correct one.
- How should we decide between a #include <foo.h> and a #include "foo.h" statement.
- Unfortunately we are an add-in, and have to sneak around behind the IDE's back, so things that are easy when you control the IDE, ... ;-)
Some solutions: - The file, where a class is declared is the primary choice.
- If this file is inside the project, a relative #include "../foo.h" is the best choice
- If the file is external, but in the regular search path, a #include <foo.h> or #include <bar/foo.h> ist the best choice.
- If the file is neither in the project, nor in the searchpath, but another file is including the target and the filename is matching the typename, this is the right choice (e.g for Qt/boost)
- In other cases, no #include is added - or a list of possible alternatives is shown.
|
best regards Tobias
|
|