## TL;DR

Back then, the iterator didn't model the range concept.

## Fix

1. Back then, the iterator didn't model the range concept.
   Expected: you can confirm this matches your situation.

## When to use

- You are dealing with this situation.
- The symptom matches: Using recursive_directory_iterator in an old version of boost?.

## When NOT to use

- Unrelated issues with a different cause.
- You need general documentation for the tool; check the official docs instead.

## Compatibility

Reported per the linked source (mentions 1.54, 1.62, 14.04, 4.8). Source: https://stackoverflow.com/questions/45983594/using-recursive-directory-iterator-in-an-old-version-of-boost.

## Variant phrasings

### Using recursive_directory_iterator in an old version of boost?

## Why it happens

I need to recursively iterate through a directory; I got a pretty nice function for it from another thread here on SO; adapted it just a tiny bit for my purposes and it works perfectly on Mac with boost 1.62 and clang. However, we're using SemaphoreCI (based on ubuntu 14.04 LTS and boost 1.54) and I just cannot get this to compile under those conditions. #include [boost/algorithm/string/replace.hpp] #include [boost/filesystem.hpp] #include [boost/range.hpp] void copyDirectory

## Edge cases

- If your error message differs even slightly, this is probably a different issue; search the exact text.
- Behavior can change between releases; the linked source reflects the versions above.
- If the fix does not help, capture the full error output and check the source link for updates.

## Source

https://stackoverflow.com/questions/45983594/using-recursive-directory-iterator-in-an-old-version-of-boost