namespace std in gcc 2.95.2
Kris Thielemans
kris.thielemans@csc.mrc.ac.uk
Tue Feb 1 08:36:00 GMT 2000
Hi,
I'm a surprised to discover that the STL library in Mumit's gcc 2.95.2 is
not put into the std namespace.
You can check this by compiling the next programme with
g++ test.cxx -fhonor-std
#include <vector>
int main()
{
std::vector<int> a(1);
return 0;
}
(Of course, it compiles fine without the explicit honor-std switch).
It can also be checked by looking at stl_config.h (see end of mail).
One important consequence is that std::iterator (or just iterator) is not
defined. (I checked stl_iterator.h, and it is only defined when
__STL_USE_NAMESPACES is #defined. )
I think __STL_USE_NAMESPACES is #defined in other gcc 2.95.2 distributions.
Any particular reason why it isn't in the cygwin version ?
Kris
PS:
from stl_config.h (note that __STL_NO_NAMESPACES is defined even for gcc
2.95.2)
# ifdef __GNUC__
# include <_G_config.h>
# define __STL_HAS_WCHAR_T
# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8)
# define __STL_STATIC_TEMPLATE_MEMBER_BUG
# define __STL_NEED_TYPENAME
# define __STL_NEED_EXPLICIT
# else
# define __STL_CLASS_PARTIAL_SPECIALIZATION
# define __STL_FUNCTION_TMPL_PARTIAL_ORDER
# define __STL_MEMBER_TEMPLATES
# define __STL_MEMBER_TEMPLATE_CLASSES
# define __STL_EXPLICIT_FUNCTION_TMPL_ARGS
# define __STL_HAS_NAMESPACES
# define __STL_NO_NAMESPACES
# define __SGI_STL_USE_AUTO_PTR_CONVERSIONS
# define __STL_USE_NAMESPACES
# endif
further on in the file, there is
# if defined(__STL_HAS_NAMESPACES) && !defined(__STL_NO_NAMESPACES)
# define __STD std
# define __STL_BEGIN_NAMESPACE namespace std {
# define __STL_END_NAMESPACE }
# define __STL_USE_NAMESPACE_FOR_RELOPS
# define __STL_BEGIN_RELOPS_NAMESPACE namespace std {
# define __STL_END_RELOPS_NAMESPACE }
# define __STD_RELOPS std
# define __STL_USE_NAMESPACES
# else
# define __STD
# define __STL_BEGIN_NAMESPACE
# define __STL_END_NAMESPACE
# undef __STL_USE_NAMESPACE_FOR_RELOPS
# define __STL_BEGIN_RELOPS_NAMESPACE
# define __STL_END_RELOPS_NAMESPACE
# define __STD_RELOPS
# undef __STL_USE_NAMESPACES
# endif
in effect, namespace std does not exist in the STL library...
--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com
More information about the Cygwin
mailing list