The following simple code definitely works. Adapt it as necessary to your own requirements.
void SimpleTest()
{
auto mydocs = fs::path(LR"(C:\Users\ ...)"); auto dir = fs::recursive_directory_iterator(mydocs);
fs::path currPath = mydocs;
for (auto& block : dir)
{
if (fs::is_directory(block.path()))
{
if (fs::is_empty(block.path()))
{
cout << block.path() << " is empty" << endl;
}
else
{
wcout << block.path() << endl;
}
}
}
}