Question about fstream and vector

Trond Bo trond.bo@dnmi.no
Fri Jan 5 12:57:00 GMT 2001


I downloaded snapshot labled gcc-20001225,
I was able to compile and install it.

I tried the following and it didn't compile.

Is this a bug or is it something I do wrong ?

// ---- Example begin -----
#include <vector>
#include <fstream>

using namespace std;

main() { vector<int> i; } 
// ---- Example end -----

Compilation produced the following :

# /usr/local/gcc-20001225/bin/c++  p2.cc
p2.cc: In function `int main()':
p2.cc:6: call of overloaded `vector()' is ambiguous
/usr/local/gcc-20001225/include/g++-v3/bits/stl_vector.h:252: candidates are: 
   std::vector<_Tp, _Alloc>::vector(unsigned int = 0) [with _Tp = int, _Alloc = 
   std::allocator<int>]
/usr/local/gcc-20001225/include/g++-v3/bits/stl_vector.h:244:                 
   std::vector<_Tp, _Alloc>::vector(typename std::_Vector_base<_Tp, 
   _Alloc>::allocator_type& = typename std::_Vector_base<_Tp, 
   _Alloc>::allocator_type()) [with _Tp = int, _Alloc = std::allocator<int>]


                                 Trond






More information about the Libstdc++ mailing list