Add another GCC2.95->3.1 compatibility header
[oota-llvm.git] / include / Support / iterator
1 //===-- Support/iterator - "Portable" wrapper around <iterator> -*- C++ -*-===//
2 //
3 // This file provides a wrapper around the mysterious <iterator> header file.
4 // In GCC 2.95.3, the file defines a bidirectional_iterator class (and other
5 // friends), instead of the standard iterator class.  In GCC 3.1, the
6 // bidirectional_iterator class got moved out and the new, standards compliant,
7 // iterator<> class was added.  Because there is nothing that we can do to get
8 // correct behavior on both compilers, we have this header with #ifdef's.  Gross
9 // huh?
10 //
11 // By #includ'ing this file, you get the contents of <iterator> plus the
12 // following classes in the global namespace:
13 //
14 //   1. bidirectional_iterator
15 //
16 //===----------------------------------------------------------------------===//
17
18 #ifndef SUPPORT_ITERATOR_H
19 #define SUPPORT_ITERATOR_H
20
21 #include <iterator>
22
23 #if __GNUC__ == 3
24
25 // Define stupid wrappers around std::iterator...
26 template<class Ty, class PtrDiffTy>
27 struct bidirectional_iterator
28   : public std::iterator<std::bidirectional_iterator_tag, Ty, PtrDiffTy> {
29 };
30
31 #else
32 // Just use bidirectional_iterator directly.
33 using std::bidirectional_iterator;
34 #endif
35
36 #endif