peter koch
9/10/2008 6:04:00 PM
On 10 Sep., 19:41, Ruben <ru...@www2.mrbrklyn.com> wrote:
> On Wed, 10 Sep 2008 17:10:59 +0000, Erik Wikström wrote:
[snip]
>
> I used
>
> #ifdef VECTOR_H
> #define VECTOR_H
> #include <vector>
> #endif
>
> Its supposed to be
>
> #ifndef VECTOR_H
> #define VECTOR_H
> #include <vector>
> #endif
>
> I want to conditionally include the header, so how can i do that without
> multiple #endif statements?
You should do as Erik recommended: put the include guard inside the
the header-file. There is normally no reason to avoid including the
same header more than once: the compiler should optimise this part
(assuming you were worried about long compilation times).
/Peter