#include "graphic/sprite.h"
#include "../some_other_dir/foo.h"
#include "graphic/sprite.h"
#include "../some_other_dir/foo.h"
Quote:My concern with this is that if I want to use some other file that's in another directory I get a lot of ugly things like ".." in the path.You shouldn't have to use "..".
*** Source Snippet Removed ***
/project/project/graphics/project/physics
Then a file, such as /project/graphics/sprite.h can look like:#include "spriteHelpers.h" // opens /project/graphics/spriteHelpers.h#include <physics/boundingBox.h> // opens /project/physics/boundingBox.h
Quote:Also if I move one file to another directory I will have to change the include for all files that uses it.This isn't really a problem in my experience. e.g. How often do you move a graphics file into the physics directory, etc?
Quote:Original post by rip-off
Hodgman has this one incorrect. "" searches for local files, and <> searches for local or system include files.
Quote:From the C++ Standard, Section 16.2, paragraphs 2 and 3
A preprocessing directive of the form# include <h-char-sequence> new-line
search a sequence of implementation-defined places for a header identified uniquely by the specified sequence between the < and > delimiters, and causes the replacement of that directive by the entire contents of the header. How the places are specified or the header identified is implementation-defined.
A preprocessing directive of the form# include "q-char-sequence" new-line
causes the replacement of that directive by the entire contents of the source file identified by the specified sequence between the " delimiters. The named source file is search for in an implementation-defined manner. If this search is not supported, or if the search fails, the directive is reprocessed as if it read# include <h-char-sequence> new-line
with the identical contained sequence (including the > characters, if any) from the original directive.
Quote:Original post by WoohYep, that happens with both file-relative and root-relative paths unfortunately.
Also if I move one file to another directory I will have to change the include for all files that uses it.
Quote:Original post by SiCraneSo there is no need to use <>? I can use "" always for my own files, nice :)Quote:From the C++ Standard, Section 16.2, paragraphs 2 and 3
A preprocessing directive of the form# include <h-char-sequence> new-line
search a sequence of implementation-defined places for a header identified uniquely by the specified sequence between the < and > delimiters, and causes the replacement of that directive by the entire contents of the header. How the places are specified or the header identified is implementation-defined.
A preprocessing directive of the form# include "q-char-sequence" new-line
causes the replacement of that directive by the entire contents of the source file identified by the specified sequence between the " delimiters. The named source file is search for in an implementation-defined manner. If this search is not supported, or if the search fails, the directive is reprocessed as if it read# include <h-char-sequence> new-line
with the identical contained sequence (including the > characters, if any) from the original directive.
Quote:Original post by dmatter
Yep, that happens with both file-relative and root-relative paths unfortunately.