0xAX
0xAX

Reputation: 21837

Boost error conversion from ‘boost::filesystem3::path’ to non-scalar type ‘std::string

I have code:

std::string firstFile = boost::filesystem::path(first->name()).leaf();

But get error:

error conversion from ‘boost::filesystem3::path’ to non-scalar type ‘std::string

How can i fix it?

Thank you.

Upvotes: 8

Views: 5571

Answers (1)

Yakov Galka
Yakov Galka

Reputation: 72549

std::string firstFile = boost::filesystem::path(first->name()).leaf().string();

also note that the leaf function is deprecated and is removed in Boost.Filesystem V3.

Upvotes: 12

Related Questions