Boost logo

Boost Users :

From: Beman Dawes (bdawes_at_[hidden])
Date: 2008-08-17 20:52:59


Scott McMurray wrote:
> On Fri, Aug 15, 2008 at 12:57, Scott Finley <sfinley_at_[hidden]> wrote:
>> bfs_test.cpp: In function 'int main()':
>>
>> bfs_test.cpp:13: error: 'class
>> boost::filesystem::basic_directory_entry<boost::filesystem::basic_path<std::basic_string<char,
>> std::char_traits<char>, std::allocator<char> >,
>> boost::filesystem::path_traits> >' has no member named 'leaf'
>>
>> My mistake, or did something change/break?
>>
>
> It looks like you now need
> itr->path().leaf()
> or
> boost::implicit_cast<bfs::path const &>(*itr).leaf()
> ( http://beta.boost.org/doc/libs/1_36_0/libs/filesystem/doc/reference.html#Class-template-basic_directory_entry
> )
>
> As I recall, this change was part of optimization efforts to make
> iterating faster by caching the file_status.
>
> Also, it was decided that some of the names for path decomposition
> functions were confusing, particularly branch and leaf, so they were
> changed. The new path decomposition table suggests that you should
> now be using filename() instead of leaf():
> http://beta.boost.org/doc/libs/1_36_0/libs/filesystem/doc/reference.html#Path-decomposition-table
> (But it's likely backwards-compatible, so you shouldn't need to.)

Yes, that's the theory. But it looks like 1.36.0 inadvertently renamed
basic_directory_entry::leaf without providing backward compatibility.

I'll try to post a hotfix for that. Since basic_directory_entry::leaf is
deprecated anyhow, my initial reaction is that it should have been left
alone.

--Beman


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