Boost logo

Boost Users :

From: Sachin Garg (schngrg_at_[hidden])
Date: 2008-08-20 16:57:16


I have following 3 lines of code, is this usage correct?

  fs::wpath input_path=somepath;
  fs::wpath output_path=anotherpath;
  output_path.append(input_path.begin()+7,input_path.end());

The 3rd line gives following error (using Visual Studio 9.0 and boost 1.35.0)

C:\Program Files\boost\boost_1_35_0\boost/filesystem/path.hpp(1058) :
error C2664: 'boost::filesystem::detail::is_separator' : cannot
convert parameter 1 from 'const std::basic_string<_Elem,_Traits,_Ax>'
to 'wchar_t'

Looking at the code, it does looks like a problem with path.hpp as
is_separator expects a wchar_t parameter but append gives it a wstring
(unless there some conversion that should have happened but isn't
happening. I temporarily changed *first at line 1058 to first->at(0)
and this fixed the error.).

And there are other errors too like

path.hpp(1068) : error C2677: binary '&&' : no global operator found
which takes type 'const std::basic_string<_Elem,_Traits,_Ax>' (or
there is no acceptable conversion)

This too seems valid as path.hpp:1068 'seems' to assume that *first
would be same as first->empty()

Is this a known issue fixed in 1.36.0? Seems like some presumed
conversions are not happening in path.hpp. Or am I making some super
dumb mistake in my usage of append()?

Sachin Garg


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