0

I have this peace of code

string targetFile = string + boost::filesystem::path.filename()

the problem is that it considers path.filename() as path instead of the string that the documentation tells (http://www.boost.org/doc/libs/1_36_0/libs/filesystem/doc/reference.html#Class-template-basic_path)

mustafagonul
  • 1,139
  • 1
  • 15
  • 32
AnotherOne
  • 854
  • 2
  • 8
  • 19

2 Answers2

5

Are you using boost 1.36? Newer versions of Boost document it to return a path:

path filename() const;
Barry
  • 286,269
  • 29
  • 621
  • 977
josefx
  • 15,506
  • 6
  • 38
  • 63
  • I have boost 1.6 , is that the probleme ? – AnotherOne Mar 21 '16 at 11:49
  • @MekacherAnis It’s not a problem, the answer is simply telling you that you are looking at the wrong version of the documentation. Here’s the [correct documentation](http://www.boost.org/doc/libs/1_60_0/libs/filesystem/doc/reference.html#path-filename). – Konrad Rudolph Mar 21 '16 at 11:59
  • 1
    @MekacherAnis It is if you're coding based on the documentation of v1.36. But you don't really *have* to do that. – juanchopanza Mar 21 '16 at 11:59
  • @KonradRudolph alright thank's , it was like a nightmare – AnotherOne Mar 21 '16 at 12:48
0
string targetFile = string + boost::filesystem::path.filename().string();

you can use like that.

mustafagonul
  • 1,139
  • 1
  • 15
  • 32