diff options
author | jthorn <jthorn@f88db872-0e4f-0410-b76b-b9085cfa78c5> | 2002-10-07 20:18:46 +0000 |
---|---|---|
committer | jthorn <jthorn@f88db872-0e4f-0410-b76b-b9085cfa78c5> | 2002-10-07 20:18:46 +0000 |
commit | 8a5de99cbfe223c1564f95b7d900bc7abd8eeb07 (patch) | |
tree | e3abc8a254b39f495861920ed30de983e1610ea1 /src/include | |
parent | f6b73eb2bba737fd76c0b8b576e02b518befa6c7 (diff) |
This change fixes problems with some compilers recognizing only <vector>,
and others recognizing only <vector.h>;
change from
#include <vector.h>
to
#include "stl_vector.hh"
(this now after includeing "cctk.h"), where "stl_vector.hh" is a
new header file that looks at the symbols HAVE_VECTOR and HAVE_VECTOR_H
(defined by Cactus at configuration time) to see what to #include
and whether or not to use an explicit using declaration to bring
vector into the global namespace
git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinAnalysis/AHFinderDirect/trunk@809 f88db872-0e4f-0410-b76b-b9085cfa78c5
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/README | 6 | ||||
-rw-r--r-- | src/include/stl_vector.hh | 22 |
2 files changed, 28 insertions, 0 deletions
diff --git a/src/include/README b/src/include/README index 8858d92..84f80ed 100644 --- a/src/include/README +++ b/src/include/README @@ -13,3 +13,9 @@ config.hh defines compile-time configuration for this thorn, eg the "fp" typedef (= CCTK_REAL), the choice of 2nd vs 4th order finite differencing, etc etc + +stl_vector.hh + This defines the STL vector class in the global namespace, + by #including the appropriate system header (either <vector.h> + or <vector> as appropriate for this platform), and possibly using + an explicit using declaration. diff --git a/src/include/stl_vector.hh b/src/include/stl_vector.hh new file mode 100644 index 0000000..9e4d817 --- /dev/null +++ b/src/include/stl_vector.hh @@ -0,0 +1,22 @@ +// stl_vector.hh -- define STL vector class in global namespace. +// $Header$ + +// +// prerequisites: +// "cctk.h" +// + +// +// This header file defines the STL vector class in the global namespace. +// It makes use of Cactus's configuration-time probing of what header +// files are available. +// + +#if defined(HAVE_VECTOR) + #include <vector> + using std::vector; +#elif defined(HAVE_VECTOR_H) + #include <vector.h> +#else + #error "Cactus couldn't find the STL vector class!" +#endif |