tuko wrote:
Hello.
Do you know if there is any standard STL header guard for
vectors, lists, maps e.t.c?
I would like to write code like that
#ifndef STL_VECTOR_
#error "please include stl vector"
#endif
std::vector<double> foo;
I am searching an elegant way to prevent a flood of
compilation errors.
Many thanks.
Tuko
If you were going to write an #ifndef line like the one shown above, then
you might just as well include the correct header in the first place.
If you really want to avoid a flood of errors, then you could always include
a file called 'library_headers.h' which itself includes all of the STL
headers that you use.
I doubt whether this is generally considered good style. Some of my code
that was originally written for C++ Builder does it, because its necessary
in order to get pre-compiled headers to work.
--
Chris Gordon-Smith
London
Homepage:
http://graffiti.virgin.net/c.gordon-smith/
Email Address: Please see my Home Page