Boost logo

Boost Users :

From: Zdravko Ba¹ (zdravko.bas_at_[hidden])
Date: 2007-09-05 05:09:46


I have a problem with boost 1.34.1 (filesystem::ofstream and format).
Compiler Vc71 and vc80
Is this is a bug or my mistake.

Zdravko

Code:
#include <boost/format.hpp>
#include <boost/filesystem/fstream.hpp>
#include <boost/filesystem.hpp>
void test ()
{
 boost::filesystem::ofstream os (boost::filesystem::path ("foo.out"));
 os << boost::format("%s\n") % "foo.text";
}
Vc80 output:
c:\projects\boost_test\test.cpp(8) : error C2593: 'operator <<' is ambiguous
        d:\libs\cpp\boost\1.34.1\boost\boost\filesystem\path.hpp(617): could be 'std::basic_ostream<_Elem,_Traits> &boost::filesystem::operator <<<boost::basic_format<Ch>>(std::basic_ostream<_Elem,_Traits> &,const Path &)' [found using argument-dependent lookup]
        with
        [
            _Elem=char,
            _Traits=std::char_traits<char>,
            Ch=char,
            Path=boost::basic_format<char>
        ]
        d:\libs\cpp\boost\1.34.1\boost\boost\format\free_funcs.hpp(33): or 'std::basic_ostream<_Elem,_Traits> &boost::operator <<<char,std::char_traits<char>,std::allocator<_Ty>>(std::basic_ostream<_Elem,_Traits> &,const boost::basic_format<Ch> &)' [found using argument-dependent lookup]
        with
        [
            _Elem=char,
            _Traits=std::char_traits<char>,
            _Ty=char,
            Ch=char
        ]
        while trying to match the argument list '(boost::filesystem::ofstream, boost::basic_format<Ch>)'
        with
        [
            Ch=char
        ]


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net