[Boost-bugs] [Boost C++ Libraries] #1389: filesystem::ostream << boost::format generates operator ambigious error (in MSVC++)

Subject: [Boost-bugs] [Boost C++ Libraries] #1389: filesystem::ostream << boost::format generates operator ambigious error (in MSVC++)
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2007-10-30 23:16:14


#1389: filesystem::ostream << boost::format generates operator ambigious error
(in MSVC++)
--------------------------------------------+-------------------------------
 Reporter: randomaccessiterator_at_[hidden] | Owner: bemandawes
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: filesystem
  Version: Boost 1.34.1 | Severity: Problem
 Keywords: |
--------------------------------------------+-------------------------------
 The following code


 {{{
 #include <boost/format.hpp>
 #include <boost/filesystem/fstream.hpp>

 void foo ()
 {
    using namespace boost::filesystem;
    ofstream file ( "foo.txt" );
    file << boost::format("hello");
 }

 }}}

 generates the following compilation error with MSVC++ 7.1:

 d:\foo.cpp(8) : error C2593: 'operator <<' is ambiguous
         d:\Programs\boost\boost_1_34_0\boost\filesystem\path.hpp(617):
 could be 'std::basic_ostream<_Elem,_Traits> &boost::filesystem::operator
 <<>(std::basic_ostream<_Elem,_Traits> &,const Path &)'
         with
         [
             _Elem=char,
             _Traits=std::char_traits,
             Ch=char,
             Path=boost::basic_format
         ]
         d:\Programs\boost\boost_1_34_0\boost\format\free_funcs.hpp(33): or
 'std::basic_ostream<_Elem,_Traits> &boost::operator
 <<,std::allocator<_Ty>>(std::basic_ostream<_Elem,_Traits> &,const
 boost::basic_format &)' [found using argument-dependent lookup]
         with
         [
             _Elem=char,
             _Traits=std::char_traits,
             _Ty=char,
             Ch=char
         ]
         while trying to match the argument list
 '(boost::filesystem::ofstream, boost::basic_format)'
         with
         [
             Ch=char
         ]



 Compiled with options
 [
 /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Gm /RTC1 /MLd
 /Fo"Debug/" /Fd"Debug/vc70.pdb" /W3 /c /ZI /TP /EHa
 ]

--
Ticket URL: <http://svn.boost.org/trac/boost/ticket/1389>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.


This archive was generated by hypermail 2.1.7 : 2017-02-16 18:49:56 UTC