diff options
author | arseny.kapoulkine@gmail.com <arseny.kapoulkine@gmail.com@99668b35-9821-0410-8761-19e4c4f06640> | 2012-03-20 06:19:31 +0000 |
---|---|---|
committer | arseny.kapoulkine@gmail.com <arseny.kapoulkine@gmail.com@99668b35-9821-0410-8761-19e4c4f06640> | 2012-03-20 06:19:31 +0000 |
commit | 3a282e2f0b21ec01626e76fa94ef0579b5326f8d (patch) | |
tree | ea0fa2a3ef17dc07f673e9fbd9547fae4d6ca290 /src | |
parent | 4935e2356f6ac3bb3fe38cc590fa461b02ff54a7 (diff) |
STL forward declaration experiment failed; revert to using STL headers. Reasons: bugs in old compilers (i.e. SunCC, DMC, BCC require using the same names in forward declarations as in actual declarations), incompatibility between buggy compilers and different STL versions (i.e. SunCC has two STL versions with mismatching names), problems with C++0x inline namespaces (used in Clang libc++, see http://llvm.org/bugs/show_bug.cgi?id=5590), and this is an undefined behavior so other problems may come up.
git-svn-id: http://pugixml.googlecode.com/svn/trunk@868 99668b35-9821-0410-8761-19e4c4f06640
Diffstat (limited to 'src')
-rw-r--r-- | src/pugixml.hpp | 47 |
1 files changed, 4 insertions, 43 deletions
diff --git a/src/pugixml.hpp b/src/pugixml.hpp index 44d4d76..74c520c 100644 --- a/src/pugixml.hpp +++ b/src/pugixml.hpp @@ -30,50 +30,11 @@ # include <exception> #endif +// Include STL headers #ifndef PUGIXML_NO_STL -// cstddef is needed so that we get the 'std' namespace declaration (STLport sometimes makes std a define) -# include <cstddef> - -# if defined(PUGIXML_NO_STL_FWDDECL) -# include <iterator> -# include <iosfwd> -# include <string> -# else -// Forward declarations for STL classes to reduce include dependencies -namespace std -{ - struct bidirectional_iterator_tag; - -#ifdef __SUNPRO_CC - // Sun C++ compiler has a bug which forces template argument names in forward declarations to be the same as in actual definitions - template <class _T> class allocator; - template <class _charT> struct char_traits; - template <class _charT, class _Traits> class basic_istream; - template <class _charT, class _Traits> class basic_ostream; - template <class _charT, class _Traits, class _Allocator> class basic_string; -#else - // Borland C++ compiler has a bug which forces template argument names in forward declarations to be the same as in actual definitions - template <class _Ty> class allocator; - - // STLport defines char_traits as a class instead of a struct -# ifdef _STLPORT_VERSION - template <class _Ty> class char_traits; -# else - template <class _Ty> struct char_traits; -# endif - - template <class _Elem, class _Traits> class basic_istream; - template <class _Elem, class _Traits> class basic_ostream; - template <class _Elem, class _Traits, class _Ax> class basic_string; -#endif - - // Digital Mars compiler has a bug which requires a forward declaration for explicit instantiation (otherwise type selection is messed up later, producing link errors) - // Also note that we have to declare char_traits as a class here, since it's defined that way -#ifdef __DMC__ - template <> class char_traits<char>; -#endif -} -#endif +# include <iterator> +# include <iosfwd> +# include <string> #endif // Macro for deprecated features |