This is the mail archive of the libstdc++@sources.redhat.com mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

#include <fstream> causes "call of overloaded `vector()' is ambiguous"


When compiling the following snippet with current GCC with libstdc++-v3

  #include <vector>
  #include <fstream>  // This is causing troubles!

  class STACK {
  public:
    std::vector<int> data;

    STACK() : data()
      { }
  };

I'm seeing the following error message IF AND ONLY IF <fstream>, which
is not needed at all, is #included:

  % gccvs x.cc
  x.cc: In constructor `STACK::STACK()':
  x.cc:9: call of overloaded `vector()' is ambiguous
  /sw/test/gcc/SunOS/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>]
  /sw/test/gcc/SunOS/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>]

Gerald

PS: Generating this minimal test case took me about an hour. :-(
-- 
Gerald "Jerry" pfeifer@dbai.tuwien.ac.at http://www.dbai.tuwien.ac.at/~pfeifer/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]